Fed2 Star - the newsletter for the space trading game Federation 2

The weekly newsletter for Fed2
by ibgames

EARTHDATE: November 23, 2014

Fed2 Star last page Fed2 Star: Official News page 2 Fed2 Star next page

REVAMPING THE GAME’S PLANET LISTING

by Hazed

Alan is continuing to work on the changes the game needs in order to allow players to link in their own second (and subsequent) planets. He has been working on the way the game stores information about the planets that have to be loaded into the game on startup.

Right now all the details of star systems and their planets resides in a big file called maps.dat. Here’s a small bit of it:

<star name='Rigel' directory='rigel'>
<map name='rigel4'/>
<map name='space'/>
</star>

When a new star system is added to the game by the auto-linking code, a new entry containing the info is added to the end of the file. When Alan manually links another planet, he edits the file to add a line for the new planet to the star system.

But if the game is going to auto-link second planets, making it search through this very long file to find the right system, and then insert a line, would take far too long. The more systems in the game, the longest the list and the longer the pause while the game carries out its search.

So the solution is to change things so that instead of one great long list, each star system will have its own list, stored in the folder for the star system. This means that when the code to auto-link is written, all the game will have to do is to add a line to the star system file, which will be much quicker.

Alan has now got to the stage of having the code ready to change the way the lists of planets work. He needs to run a conversion program on the existing maps.dat file, to chop it up into the individual star system files needed for the new system. This will happen next weekend – so this is your heads up!

If all goes well, you won’t notice any difference. This is all background stuff that doesn’t affect gameplay. So there’s nothing to worry about.

Honest!

Fed2 Star last page   Fed2 Star next page