Archive for March, 2009
Refactoring In Eclipse
Eclipse is awesome for refactoring code. You can rename a class, it’s filename and all it’s references in all projects with one click. Amazing.
Add comment 11 March, 2009
Steroids Update
I spent the most of the night refactoring the network code for Steroids. I will admit that I am not so good at Java. Getting there slowly
Learning a new programming language is easy. Learning a new Library is not. Especially considering the size of the standard Java library. It feels like I am coding with broken hands. Everything is slow motion and most changes need me to search the documentation.
The refactoring has paid off. I now share almost all of the network code between the server and the client. It’s actually quite nice. I need to share a lot of code between the client and server as they both need to implement the game logic in sync. Once I started that i decided it would cut out a lot of lines if I also shared the network code.
I have also created a new demo video. Changes include multiple clients connecting and dirt that can be destroyed!
Notice how the dirt is destroyed but not the tree’s? The tree’s are on the “Stone” layer of the map. It is for obstacles that the player can not destroy!
Add comment 10 March, 2009
Setting build path has encountered a problem
‘Setting build path’ has encountered a problem.
Could not write file:
.classpath.
Details >> Could not write file: (Access is denied)
I kept getting this message in eclipse when attempting to change the dependencies under the project properties. The cause was copying a workspace from Linux to Windows. The windows hidden attribute is set on the .classpath file. Removing this attribute fixes the error.
Add comment 10 March, 2009
Steroids Update
I have just completed the code to draw the map background on the phone. You can scroll around the screen by dragging with your finger. Sort of like Google Maps.
You can see a video here:
Add comment 7 March, 2009
Few mobile app ideas
Instrument Tuner?
Network co-op side scroller.
Multiplayer block destroying.
4 comments 5 March, 2009
Multiplayer PONG on high latency network
What if you modified the speed of the ball depending on the latency. You would see the ball coming at you full speed but you would see it head toward the other player slightly slower.
If you had 500ms round trip to the other player then you could make the ball 500ms slower heading to them on the screen. You would recieve the message of where they hit the ball at the perfect time in the animation. The other player would see the reverse.
Would this work? hrmmm.
Add comment 5 March, 2009
Good Netcode on High Latency Network
The optus 3G network has 1000ms latency. That means Steroids will need some clever code to deliver a smooth multiplayer game experience.
My basic idea is to only send the clients events that change the game. If no one clicked a button in the game then the clients would only get a start and game over message.
As long as all the clients and the server share the same physics code they will all see the same game.
The challenge comes when the client receives a message about an event that occoured in tha past.
For example at tick 1 client A made a oid explode.
That message gets sent to the server and arrives at tick 25 ( 1 second later )
The server forwards the message to client B which arrives at tick 50 ( another second later)
Client B now has to change the game around an event that happened 2 seconds ago.
Every event in the game you will store in a list. That means you could theoretically replay the whole game from the start just using the list of actions provided by players. I reakon you could probably replay the physics for the whole game in memory during a single frame. So for a past event you would insert into the list at the right point and then replay the whole game in memory.
If that takes too much processing power then I plan to save the game state in memory once every couple of seconds. My calculations say it will likely take less then a meg of ram over the life of a game. Then you only have to roll back then forward a small number of ticks.
Add comment 5 March, 2009
Steroids
Steroids is the name of the game. See the previous post about the theme. I have completed the initial threading and network code for the client and server. The two connect and can exchange messages.
A game loop is running on both client and server
Clients are automatically dropped into an open lobby. Propper lobby code can follow later. Games start automatically after the lobby has been open for a few minutes with more then one player or the lobby reaches 4 players.
The basic network code is done. The game loop on the server can easily send messages to each client or broadcast to all of them. ( the clients in that particular game )
I am working on a fixed 25 ticks per second physics system. That is 40ms per update.
Next up is the basic game rules and physics. Or perhaps the initial graphics for the client.
I have a great idea that will give great game play over high latency networks. The only network in australia selling the G1 is Optus and their 3G network has 1000ms latency!
Add comment 5 March, 2009
Multiplayer Android Game
This is my first post about a multiplayer game I have been working on for a few weeks. It borrows an idea from an old dos game called Lemmings. Each player is tasked with getting a team of little characters from point A to point B on a 2D map.
Blindly walking characters on a 2d map is the only similarity. The game will not be about using limited resources to solve a puzzle, it is about getting to the goal whilst inflicting as much damage on the other teams as possible.
The very very early prototype I am working on at the moment supports 4 players and is written in Java for the Google Android platform. I don’t have an android phone but am developing on the HTC Dream (TMobile G1) emulator that comes with the sdk.
The game theme “subject to change” is based around stereotypes since they blindly follow each other. The characters will be called oid’s there will be emo emoid’s, some blond bimboid’s etc. I have drawn basic 8 frame character walking sequences for prototyping but I think I will need a real artist for the finished product.
Post in the comments if you have any ideas you would like to see in this game. I can imagine combining a hole digger and suicide oid to blow up a bunch of enemies in a hole.
I reakon it will be a pretty fun game. Infinite replayability.
Add comment 5 March, 2009
Political Blog Posts
No one reads them. I’m pretty sure I could search the net and find someone blogging the same exact crappy opinions as me.
No more!
Add comment 5 March, 2009