loading up levels

Blitz3D Forums/Blitz3D Beginners Area/loading up levels

melonhead(Posted 2009) [#1]
hi i am kinda new to this i am more of a 3d graphic designer then a programmer i just got by just loading models i made to test them in blitz for others, i really want to know how to program and i have a problem i am working on a beat em up game. i'm using my town as the model it self and i want to load up from one model to an other and back as many time needed like in final fantasy 7 and still keep the information going back and forth. if this dont make sence im very sorry


Zethrax(Posted 2009) [#2]
You're right - none of that does make sense. Punctuation is a wonderful thing.

Firstly, I'd suggest you browse through the documentation and samples that came with Blitz3D to get an overview of what the language can do and how it goes about doing it. Also look at the online manuals, as they contain comments which add further information.

Also, look at the code archives on this site. Download a few of the examples and have a play around with them.


melonhead(Posted 2009) [#3]
sorry about that; ill post in what i have done so far in worklogs im working with Tiberion RPG im the graphics designer a lot of the graphics are sub graphics. im working on better once to replace them . i just want to work on something on my own for once.


Kryzon(Posted 2009) [#4]
If you are refering to the original FF VII, for the PC and PSOne, then you should know that the levels were pre-rendered (they were static images and not real-time 3D models).

The only level model there was probably a simple, invisible one used for collision detection.

Is that what you want to do?


melonhead(Posted 2009) [#5]
like in any rpg go to one room to an other close out all events from last room load up the next room but still have the stuff in the old room the way you left it. example: i move a pen in this room go to next then back that pen is were i moved it to. the only thing that change is the music


Matty(Posted 2009) [#6]
Well, there are many many ways of doing such a thing, which makes it a little difficult to know where to start giving advice.

A lot of it depends on just how much detail there is in this world, whether interior and exterior environments are separated, whether rooms within interior environments are stored separately, or if each interior environment is stored as a whole.

There's a lot too think about depending upon the complexity of the game.


melonhead(Posted 2009) [#7]
im oging to finsih working on the first level once i don modeling it ill post for some help in what to do. i managed to read up on some good stuff let me get the model in while i have it fresh in my mind. once im done ill post a screen shot on what im working on


PowerPC603(Posted 2009) [#8]
When you start your game, you could initialize everything to a default setting by creating types for every moveable thing in your world.

Then when you move that thing (a pen for example), you overwrite the data in the type that belongs to that pen.

Suppose that pen was initialy at coords 10,10.
After moving the pen, you moved it to 10,15.

Then the type instance for that pen should have the new coordinates after moving the pen.

Afterwards you go into another room and back to the room where the pen was.

When you load the room, you should recreate everything based on the data that's in the types, which belong to that room.

Since you've not modified the data when changing rooms, the pen should still be in the last position you left it.

AFAIK, this is how solid state machine work.
They always save the state of everything after modifying data (or at least, they save the new data whenever it's changed).

Pseudo-code:
Type TObject
	Field BelongsToRoom
	Field X
	Field Y
End Type

Function MoveObject(obj.TObject, newX, newY)
	obj\X = newX
	obj\Y = newY
End Function

Function LoadRoom(RoomNumber)
	For obj = Each TObject
		If obj\BelongsToRoom = RoomNumber Then
			DrawObject obj, obj\X, obj\Y
		EndIf
	Next
End Function


So, when you start a new game, setup all the objects in your world (create all needed type-instances of type TObject) and initialize their default position and also setup the roomnumber to indicate the room they belong to.

Then when you enter a room, you loop through all TObject type-instances to find out which ones belong to that particular room and draw them at the given coordinates in that TObject type-instance.

When you move something, just update the coordinates of that object.

Whenever you move to that room again, the updates coordinates are still in that type-instance and the LoadRoom function draws everything in the state when you left the room.