Release Hase - Prototype two


Ziz

Advanced Member
Joined
Jan 15, 2006
Messages
3,583
Hi,

Since a long time I wanted to make a network game. For me as game developer it is quite hard to write a game, which people want to play even after a long time. Highscores only work as long until someones makes THE highscore, which is unbeatable. C4A doesn't help much, exactly the same problem - but online (yeah!). These days it is hip to implement some kind of "achievements", but to be honest... This is the same like binary highscore, but plenty of them. And it is nothing special to achieve all. Many people do so. And if you did you are done, will deinstall the game and never touch it again (except some decades later to emulate it somewhere else). So, which games are very popular, even decades after coming out? Right: Starcraft, Diablo, World of Warcraft and all these kind of games. Why? Of course, Blizzard makes great games... But above all they have excellent network support. It doesn't matter, that some player maybe onces scores over 9000, every new game decides again, who is the very best.

hase3.png


[The next chapter gets a bit theoretical, feel free to jump to the read "jumper"]

So some weeks (or meanwhile months) ago I thought about approaches for such a network game. There were some problems blizzard didn't have. First of all, I only develop in my spare time. So the approach should be easily doable. Furthermore I don't own a server farm. In fact I don't even own a server, all I own is a NAS. So my first idea was, that my NAS could be a game server and everybody connects to it. But with this I would write a network application, which runs in background all the time and if I make one fucking sprintf wrong, an attacker could probably easy take over my little machine with a buffer overflow. Short: I was just to inexperienced with networking and furthermore had too few time to make the application save. So my next idea was, that a very simple webserver just shares the IPs of users, who wants to play and these players "just" connect to each other. However because of routers this would only work with UDP/IP packages (for the non IT people: UDP/IP packages are sent without a check, whether they arrived. TCP/IP checks, whether the packages arrived), but I really needed TCP/IP (for reasons I will explain later). Furthermore even the UDP/IP attempt is very fiddling and again I need the experience of Skype and Co to get this to work.

I also have to solve the problem, that the Pandora's Wifi is quite instable. If the connection is gone even for a minute, the show should go on!

So I had these crazy idea, which I implemented later and which works quite well: I use already setup server machines and make only little scripts, which save and give some data in and from a database. I don't have an own server, but ED was so neat to give me some space and bandwidth on his server, so I am able to launch php scripts and to store and load data from a mySQL database. The data itself I transport via HTTP POST.

This approach has of course some benefits and some problems. First of all it is easy to debug, because I just could watch websites, whether something worked or not. Furthermore as I use the HTTP protocol it is easy to add more functionality or to send more data, which needs the server. The server itself does a couple of things. It manages the available games with their meta data (number of players, time per round, players themself, level design and stuff like this). Furthermore it is possible to chat via the server and of course to transmit game data. For this every seconds I send 1,5KB of data with 1000*12Bit, which contains, which 12 buttons were pressed every microsecond from the player. The 12 "buttons" are left, right, up, down, (A), ( B) , (X), (Y), (L), ® and of course (Start) and (Select). As always I want to stay compatible to other consoles, so the keyboard or Nubs are not transferable. ;) You may see now, why I need to know, whether the package arrived. I need every button the player entered to stay synchronous.

hase1.png


But you may have already gotten the problem of the approach: The server is not able to send data to the client spontaneously. To avoid the router problems the clients always open a connection to the server and in this specific moment the server can tell, whatever it wants. If the connection is over, the server can't tell anything anymore. So ingame I ask every second "Did the player X have data submitted?" and the server can say "Nope" or send these data. Furthermore I have to ask the server every 10 seconds, whether new games are created and every 5 seconds, whether a game has changed (new users, new level design, chat message).

So I started with a little test application, which just sends HTTP POST messages and retrieves some answers from the server. The server retrieves these HTTP messages, does some database magic and delivers data. Then I made some kind of lobby and in the end implemented it in the game itself. Sounds easy, sounds fast, but in fact it was a pain in the ass and did take LONG time. ;)

hase2.png


Jumper

Let's start with a video. You will see the game list view, in which all open games are shown. You can join or create a game. In this demonstration I already created a game on the pandora and join this game on the PC. The video is made on the PC, however as said the game runs on the pandora at the same time, too. If you create a game, you can create it online, seeable for everyone, or local. Only as game admin you can add AIs, but every player is able to add even more "human" players on the local machine. So two people could play on the same pandora, a third person on the GCW and furthermore 3 AIs. All this is possible, because of the turns being on after each other.

I made the AI more or less deterministic. With this, the AI movement doesn't have to be submitted. ;) As mentioned before, to use network games, you should have at least 2 KB/s up and down speed (which are not used at the same time, so 2KB/s up OR down speed are fine). You will also see, that you have sometimes to wait quite a long time until game data arrives from another player. However unfortunately I can't change much about that. And with my approach you can't "just" start a dedicated server, you need always php mysql (for now).

https://www.youtube.com/embed/YJF4NufZLlQ?feature=oembed
So what is new at the end of the day?

  • Network play with lobby, chat, adding and removing AIs and stuff like that
  • More than two players. In fact you could play with dozens of players, but the map would get quite full ;)
  • Colours for the players
  • Fixed some glitches in the physics
  • The AI is smarter and has fancy international double-barrelled names
Of course there is still a lot of work to do. And I don't think, this will stay a prototype. I don't have time to make programs twice (prototype + better implementation), so I will try to fix the issues in the prototype to make it a real application. Furthermore the game play isn't even implemented at all! If you remember Worms, you have more than one character per player. And teams. And different weapons. And wind. I am not sure, whether I will implement wind in space (sounds freaky), but many of the other things have to be done for a real game. And music and sounds effects of course. But later. For now this was a "fast test", which took me 2 or 3 months of bus drives to and from work. Furthermore some full days at home. The pandora is a quite neat device, but at least for 2 coincident game sessions to test, whether the networking is working properly, it is too small. ;)
hase4.png


So, have fun with this! I will release a GCW version soon™, too. But unfortunately I can't test it, so this may take a while.

The application is in the repository: http://repo.openpandora.org/?page=detail&app=hase_prototype-hase_prototype-12345

(GCW Version: http://ziz.gp2x.de/downloads/hase/hase.opk)

Greetings, Ziz
 
Last edited by a moderator:
The server side stuff may have been better to use nodejs as its asynchronous approach is really fast. But well done with your idea and thinking of a cool way to make it work.
 
Just played a bit.  The room creation stuff is a little intimidating at first, but not too hard to get into.  It'd be nice if it showed where the bullet landed after each shot, as with two players that happens automatically, but with more you have to wait until your turn to find out if it hit you (and wait until you notice you're not playing any more if it was enough to kill you).

Other than that obvious stuff it's still lining up to be a cracking little gem.  Very impressive!
 
Just played a bit.
Yeah, someone did it! :D
The room creation stuff is a little intimidating at first, but not too hard to get into.
Room creation... This sounds maybe better than "New level". It is hard to find an easy, short explanation for it...For anyone who cares: The level itself is committed as string, which defines the width and height and the position of every circle, triangle and quad. Such a levelstring looks like this:

3 16o 16o*92 gh 1*nc y4 8*gt b6 2u^hn ho gm uj cl ji^p2 rl p6 s1 vi nq^cy a7 f7 bk e6 9z#ns id i8 rd r9 wx ws nx#l0 pb lk id em ht e2 or#fz mk m0 px pd jv jc giIt starts with the texture to be used. "16o" is the width and the following "16o" the height. To save space I used base 36 numbers, so the digits go from 0 to 9 and then from a to z. ;) "*" starts the definition of a circle and the three following numbers are the position and the radius. Similar for the rectangle (#) and the triangle (^).
It'd be nice if it showed where the bullet landed after each shot, as with two players that happens automatically, but with more you have to wait until your turn to find out if it hit you (and wait until you notice you're not playing any more if it was enough to kill you).
Yes, the camera definitely needs more attention. I didn't invest any time in this at all. The first prototype was about "making the gravitation idea fast" and this second one about "make networking work".
Other than that obvious stuff it's still lining up to be a cracking little gem.  Very impressive!
Thanks. I may improve some little stuff just for the game play (like some labeling or the camera movement), but the whole game gets a freeze again until I have enough time and mood to continue finish it. However I think it could already make a lot of fun and I am looking forward to play against someone in a network game. :D
greetings Ziz
 
Oh, I meant room creation stuff as in lobby room, not levels/maps.  Perhaps the buttons you press to do stuff could use some attention, or perhaps I just need to get used to it, but I found I kept having to read the legend to work out what to do there, but having done that, a local AI game started easily enough.

I'm up for a quick round at some time if we can sort out timings.  I only have a Pandora though, so I can't test your GCW build.
 
The GCW test was tested, thank you. Otherwise I would not have posted it here.

Yes, the room creation stuff (especially giving a game name!) is very overdone for a simple, local single player game. So maybe I should

a) Change the default game to local

B) Put some generic dummy name as default

EDIT: I only had to change two lines in code, which I just did. :D
 
Last edited by a moderator:
It has happened!

I played my first game over internet with another human player, but not with some random human player on some random machine, but with zear in another country on his GCW!

Pandora vs. GCW! This is so AWESOME!

I think I really should implement chatting while ingame. :D

Greetings,

Ziz

PS: I won. But I made the game, so I think in fact that doesn't really count...
 
New version with better camera movement in the repository!
 
Nice, that's mostly an improvement, especially seeing the target after the shot, though the decision to focus on the midpoint of the player and bullet can occasionally give you overly abstract camera angles.  Not sure the best way to go to fix that though.

Other oddities, I created an online game but when nobody joined immediately, I created a dummy local player and started the game.  There still seemed to be more lag than I was expecting, especially at the end of the game where I managed to hit A enough times to get an error from the main menu, as my presses were cached while it ingnored my input, then fed through when it had changed to a different screen.  Easy to learn to wait after the game end screen after the first time, so perhaps it's not the most pressing concern.

Other oddities - it continues to display 'start to help' when other characters are playing, but the key does nothing unless you have control.  And it'd be nice to be able to quit a local game once you've died.
 
Nice, that's mostly an improvement, especially seeing the target after the shot, though the decision to focus on the midpoint of the player and bullet can occasionally give you overly abstract camera angles.  Not sure the best way to go to fix that though.
The angle depends totally on the player's rotation... Just the position is between player and bullet. However I liked the view. I also tested to follow just the bullet. Maybe I should make it configurable in the endversion. ;)
Other oddities, I created an online game but when nobody joined immediately, I created a dummy local player and started the game.  There still seemed to be more lag than I was expecting, especially at the end of the game where I managed to hit A enough times to get an error from the main menu, as my presses were cached while it ingnored my input, then fed through when it had changed to a different screen.  Easy to learn to wait after the game end screen after the first time, so perhaps it's not the most pressing concern.
Interesting... I have to try reproduce that! :D
Other oddities - it continues to display 'start to help' when other characters are playing, but the key does nothing unless you have control. And it'd be nice to be able to quit a local game once you've died.
Hm, good points... In the endgame the control will change anyway. However I can quit a local game after I died: Just press Select? I implemented your suggestion to be able to close/open the help anytime. :)
 
Ah, I never tried pressing select. Regarding the lag, it's possible my Pandora fell off the network while I was playing - it has a habit of doing that, and I can't remember if it was still connected when I quit.
 
I implemented Replays:

http://youtu.be/R__ywjdzLos
 
Last edited by a moderator:
Looks good already, destructible environment, zoom, remembers me onto the first Worms game, could work at the end. :)  Does the engine have the ability to generate more "natural" environments with fixed top and bottom position like in Worms? Or will this "free space rotation" style be kept for the entire game?
 
Other oddities, I created an online game but when nobody joined immediately, I created a dummy local player and started the game.  There still seemed to be more lag than I was expecting, especially at the end of the game where I managed to hit A enough times to get an error from the main menu, as my presses were cached while it ingnored my input, then fed through when it had changed to a different screen.  Easy to learn to wait after the game end screen after the first time, so perhaps it's not the most pressing concern.
I may have fixed this bug, too. First of all I tell the user now, that data are still submitted. Furthermore I clear the input cache after the game.
 
Looks good already, destructible environment, zoom, remembers me onto the first Worms game
Why only the first? Did they change the game principle? O_O But obviously this will get a worms clone in space. :D
could work at the end. :)
The GCW community likes it. There were already games with 4 or 5 people. And now with the replay function... This could really get awesome. :D
Does the engine have the ability to generate more "natural" environments with fixed top and bottom position like in Worms? Or will this "free space rotation" style be kept for the entire game?
It will, because if you want to have positions like worms, you should play worms (or hedgewars). My game will never get this good in this kind of gameplay. I concentrate on the rotation in Space idea. ;)
 
How about a game mode where both players have 6 jumps.  Dont really know what the magic number is, could be 3.

There is LOS on the map.

All players start out at the same time and decide when to fire.

The jumps are like mini turns.

Also there are powerups. See the player in LOS at beginning of turn anywhere on the map. Regret a jump. Bigger blast on cannon.

Crashing into eachother throws you off course, so you begin somewhere you weren't when you ended a turn.

Flying from a crash does not remove LOS.

Its a game of calculating the lag. Your best chance is if you see a player at the start of a turn, your opponent will then be one hop away.

Who shot from where, where am i, where is the best place to get to, what do the other players know?

At the end of each turn, it is replayed, and you see all movement that has happened in the LOS you have removed.

You can blast yourself to rocket jump somewhere, this has more range than jumping.

Kinda like battleships, only you get to also move your battleships.

You can also deflect damage, which costs one life unless you are hit. Each player has 3 lives.

When a player dies it gets to see the replay of the whole round up untill that point. You are still in the game, and can trashtalk and cheat at will.

This adds an element to the game where you could be lying.

If its 2v2 or 3v3 it could be fun if the chat was realtime.
 
Last edited by a moderator:
Back
Top