Hello all, just to say I am new to Panda and indeed programming full-stop. I thought that maybe a way to learn to program would be to make a game as it would be more interesting than writing a database.
Anyway my question is as thus. My game will revolve around combat between spaceships (original huh) but a more long range tactical kind of approach - not too far from WW2 naval combat in space. Now I have a lot of info to get in to my program about the ship names and details (sensors, weapons, speed etc etc). What would be best way of doing this? I thought maybe having a CSV file and reading from that rather than hard coding everything inside my program. Would that be a good route to go down?
Edit: reading this again I am now realise I am kind of writing a database doh!
As a database, I would suggest going to xml.
But If I may…
Asking this question probably mean your current project is too big for a start.
Start scaling down your project: Do a battle between 2 identical ship ( hard coded) with low number of possibility ( move and shoot only)
Once that’s working, start adding functionality: more option, more ship…
You will be adding a database soon enough !
Don’t be afraid to write code that you will replace later on. Even professional project rewrite most of their code a lot of time before the final iteration.
I have got basic combat working - emphasis on the basic though. What I want to do is make a little scenario maker. Something along the lines of choose say 1 from database and ship 17 from the ship database and see how they work out against each other under different conditions. This way I hope to balance things a bit before even contemplating the main game.
Now I have all the ship info etc in excel sheets and was wondering whether I could utilise straight from them or if I would be best just keeping all this info in the code. My theory was taking it from an external source, i.e the excel sheets, might make it easier for me to tweak ships stats etc. Maybe I am wrong on that assumption hence the question.
No, Your assumption is good. ( it’s also a good idea because it allow people you are not familiar with coding to create ‘levels’ )
But Like I said, xml is a good choice( look at elementTree in python to parse or create file)
Or you can write it simply on a text file and parsing it yourself.
I’m not sure about excel. Is it easy to use without microsoft tools ?
if you ask me, I would simply use CSV strings if there is no need of complex relational intricacies. I totally hate to handle XML and if possible I avoid it as hell. CSV files are simple to manage and every application in the whole planet can import/export’em easily. Keep things as simple as you can, especially if you plan to make big things, the “dividi et impera” motto in your pocket and you’ll see the end of every project you’ll start.
Thanks for the advice. I really am at the beginning stage of learning and whilst I am more than happy to plow ahead down the learning road its always good to know you are going down the right road!
Hopefully I can get something up and running soon to show I have learned something. But I have to learn to some Blender first as at the moment the cube attacks sphere depiction isn’t exactly presentation heaven!
two other pieces:
this is to learn blender faster
this to have a project similar to what you’re trying to build, ready to go to study with