using types in my space exploring game

Blitz3D Forums/Blitz3D Beginners Area/using types in my space exploring game

mudcat(Posted 2004) [#1]
I'm making a space exploring game.Kinda like rpg in space.I have a thousand solar systems i can explore.Each system can have up to 8 planets,astroid field,aleins,and a few unknown objects.

using types for the systems

type systems
field x,y ;for the galaxy map
field explored ; if u've been there or not
field planet1 ;what radius around sun for solar system map
field planet2;
etc...

AND now I need to describe the planets,aliens,etc....

if I do that...my type will be huge...is this good coding?What would y'all suggest?Or does this sound right.
Don't need code just pointed in right direction.

What I'm going to do is make this planets,aliens and things when u enter the system,but keep them when created.

Thanks,
mudcat


WolRon(Posted 2004) [#2]
Sounds fine to me. Memory limits of computers today are very large. Shouldn't be a problem.


dmaz(Posted 2004) [#3]
that's what types are for... but you should split all your "things" of the same context into their own types like so:

Const SYSTEM_MAXPLANETS = 9

Type system
	Field name$
	Field size#
	Field planet.planet[SYSTEM_MAXPLANETS]
End Type

Type planet
	Field name$
	Field size#
	Field system.system
End Type

s.system = New system
s\name = "Sol"
s\size = 1

s\planet[0] = New planet
s\planet[0]\name = "Mercury"
s\planet[0]\size = .054
s\planet[0]\system = s

s\planet[1] = New planet
s\planet[1]\name = "Venus"
s\planet[1]\size = .88
s\planet[1]\system = s

p.planet = s\planet[1]

Print p\name+" in the " + p\system\name + " system, is " + p\size + " the size of Earth."
WaitKey
End



mudcat(Posted 2004) [#4]
Thanks for the reply,dmaz..excatly what I was looking for.
Need to study it but it's basicly types in type using a touch of array.:)

thanks,
mudcat


PCBGuy(Posted 2004) [#5]
You can use the ReadFile command and put your data in a seperate file. You will need to use other commands like
FilePos
WriteFile
ReadBank
etc....