Project PLASMA FPS

Blitz3D Forums/Blitz3D Programming/Project PLASMA FPS

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

So you want to store all informations in pivot labels?
Not entirely, just the entity's position and/or geometry will be extracted from the level map "level01.b3d". Additional properties specific to the entity would be stored in a separate data file "level01.csv". The engine would bind the data to the entity by label id upon load.

The idea is to provide a simple visual design interface mechanism in which level builders can orientate game entities in the level map using available geometry editors. Qoole, QRadiant, Wed, WorldCraft, CShop, and many other popular commercial game editors provide a visual interface to orientate entities.

I totally agree with storing additional entity properties in a textfile of some sort. TBFPS uses MySQL database, but, for a generic FPS framework, a text file will work nicely. I would recommend the *.csv or Comma Delimited Text Format. You can easily import and export the data into your favorite spreadsheet app and manage the data in the form of table. You can also use any other text editor (ie: notepad) to edit the data.

There are several csv utilities available in the code archives: Read Comma Delimited String, CSV Generator, Split CSV parameters out of a string. Here my version of Unknown's Split CSV Code.
test.csv (generated with Excel)

A String,Another String,etc
Though it rain daggers with their points downward.,"Burton, Robert",1576-1640
"Beware the Jabberwock, my son!",Lewis Carroll,1832-98
Dim cvsfield$(500)

file=ReadFile("test.csv")
If  Not file RuntimeError("No File Found!")
While Not  Eof(file)
	fields=cvsRowRead%(file)
	Print "Fields="+Str(fields)
	For loop= 1 To fields
		Print cvsfield$(loop)
	Next
	WaitKey() 
Wend
CloseFile(file)

Function cvsRowRead%(file,delimiter$=",")
	row$=ReadLine(file)
	column=1
	cvsfield$(column)=nil$
	quote=False
	For loop=1 To Len(row$)
		char$=Mid$(row$,loop,1)
		If char$=Chr$(34) 
			quote=True-quote
		ElseIf char$=delimiter$ And quote=False 
				; end of column
				column=column + 1
				cvsfield$(column)=nil$
		Else
				cvsfield$(column)=cvsfield$(column)+char$
		End If
	Next
	Return column 
End Function