Things I’ll probably have to take out to gain some bytes back:
- There’s some debug code still in there for printing frame rate and creating initial object positions
Removing this will gain a dozen or two bytes. No pain.
- Removal of cursor key control
This just leaves ESDF keys plus WR for strafing. This is unlikely to save more than 10 bytes (if that), so will leave this until I get really desperate.
- Tagging of players with their login names during multiplayer
There’s several library calls that only apply in this code including System.getProperties(“user,name”) and a couple of string functions to convert strings back and forth between byte arrays of “UTF-8”. I probably can also lose graphics.drawString if I don’t use it on the overlay. There is also dedicated code to work out where to draw the names on the screen.
Players will still appear in white, so there is no real loss in 2-player. It’s a bit more annoying for 3-player.
I like this feature as it gives a real online multiplayer feel, but the reality is that most people will only try it as single player, so it will have to go. I think this could save 100 bytes, maybe even more.
- Removal of mouse targeting control
I really don’t want to do this. At the moment, the player can only fire one fireball at a time. If I allocated more slots in the network code, it wouldn’t be difficult to allow more than one at a time, which would give a better player feel. However that would generate more code, not less, so park that thought.
The space bar could be used to generate a forward firing fireball. However it’s hard to target accurately without reducing the player turn rate. There is also a problem with Y-targeting because the ground is variable height. I could make the fireballs follow the ground contour. This isn’t hard as the game already works out the ground height under the fireball to detect terrain collisions. This would need modifying to override fireball height. It would also need to override the height of other players fireballs as the game linearly interpolates remote object positions. It may no longer be required to synchronise object Y coordinates across the network at all, which is a wider reaching change, although it probably wouldn’t save many bytes as that code is mostly generic in the way it handles the 3 axes.
Definitely a retrograde step, but it might save 50 to 100 bytes.