Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Chemical Warfare: menu, networking and compound locations
PostPosted: Sat 10 Jan 2015, 17:26 
Geneshift Creator
User avatar

Joined: Sat 14 Mar 2009, 17:50
Posts: 6047
Location: Sydney, Australia
Gender: Male
Man I am smashing this!!

Today I got all the boring behind the scenes menu and networking stuff out of the way. I finished up all the stuff in the menu plus did networking for the new game elements. There's a lot of stuff you wouldn't think about but whenever I add a new server option (like number of compounds) I need to make sure that it's sent across from the host to all the clients, plus allow admins to update and edit these new server options as well. I also have to do stuff like create new translations, saving the new options in the server settings, updating the stats tracking to include the new game mode, etc.. There's just a lot of stuff you wouldn't think about at first glance. Fortunately all these systems are already in place from existing game modes so it doesn't take too long to copy it for the new stuff. Basically now the entire menu, map editor and website changes are done.

Next up I started working on the compounds, and copying the compounds saved in the map into the actual game. The position of the compounds is going to be randomly generated so that each game is different and replayable. But with randomisation comes issues with balance. What if all the compounds randomly generated right next to the scientists base? Not fair and definitely not good for a ranked game. So what I do is add up the total distances from the sci spawn to each of the compounds and compare that to the distance from the rebel spawn. Then I try all the possible combinations until I find the arrangement that is most evenly balanced between both spawns. This not only ensures balance between both teams but also that the compounds are nicely distributed around the map.

For the dynamically generated compounds I had to do some pretty complex coding to actually choose a suitable location. It needs to be in a playable area, meaning that it can't be a kill tile or a collidable building, and you need to be able to actually walk to it from the spawn zones. The ground it's placed on needs to be flat and preferable it should be nicely positioned out in the open so it's easier to get to with vehicles and to cover with snipers. So I had to do some coding where I randomly choose a location on the map, test it for all these conditions and only if it passes add it to the list of compounds that will be randomly generated for this round. Took a good 5 hours but finally got it working :D

Anyway I am now able to set how many compounds I want in the menu, start the game and see all the compounds randomly generated and displaying in the minimap. All in accessible, open areas and evenly balanced between both spawn zones. So far so good!

_________________
Creator of Geneshift and Nik Nak Studios. Hope you enjoy the game!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron