Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (TedMar, AndrewAMD, fairtrader), 578 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Excel/OpenOffice as Gamedesign tool #173693
12/19/07 00:15
12/19/07 00:15
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
A very nice (and more professional) approach to manage your gamedesing
is to use an external tool to create data for your project.
To be more flexible than editing everything in long "define scripts", (some people even hardcoe that directly into the code)
you can use a Table calculation Program such as Excel or Calc (Open Office)
as gamedesign tool.

You can insert any kind of data, such as
file-names of the models,
properties of units (like HP in an RTS)
and also all
String-lines used in character dialogues.

Using Excel for example is much more flexible, and easyer to use than entering
that data into an SQL Database.
For a good workflow in larger Projects you should think about to link all
your game-desing editings that are prone to many changes into such a table.

To get the information into 3dgs, you can export a table into the simle csv format.
In this, alls entries are seperated by commas, or ";".
This can be read into 3dgs, and inserted into your data-arrays, or string arrays.



Here and example c-script code, to load Strings and Variables from the file:

/*

Loader: read Database-Entry tokens
from a ".cvs" type file (like csv export from OpenOffice)
(does not operate with Excel without adaptation)

entries are seperated by comma, or linereturn
Strings are indicated by quatationmarks

loader_openFile(filename) : opens file
loader_readToken() : insert numeric values to loader_readVar; Strings to load_fileString
loader_closeFile() : close the file after reading

loader_endOfFile-> if 1, file has no more content

loader_isString = 1 ; is 1 when a String (not var) was read as Token
*/

string load_fileString;
var loader_readVar;
var loader_filehandle;
var loader_endOfFile;
string loader_readString;
string loader_partString;
var loader_isString;

function loader_openFile(load_fileString){loader_filehandle=file_open_read(load_fileString);loader_endOfFile=0;}
function loader_closeFile(){file_close(loader_filehandle);}
function loader_readToken()
{
var loadCheck;
var length;

loader_isString=0;
if(loader_endOfFile){loader_closeFile();return;}

loadCheck=file_str_read(loader_filehandle,loader_readString); //read a token
if(loadCheck==-1){loader_endOfFile=1;} //"-1" -> end of file reached
if(loader_endOfFile){loader_closeFile();return;} //end of file already reached!

length= str_len(loader_readString);

//check if String or numeric entry:
if(length>0)
{

str_cpy(loader_partString,loader_readString); //copy to temporyry String
str_trunc(loader_partString,length-1); //only leave first char

if(str_to_asc(loader_partString)==34) //is a quatotaion mark -> " = 34 ASCII
{
str_trunc(loader_readString,1); //remove end quatotaion
str_clip(loader_readString,1); //remove beginning quatotaion
loader_isString=1; //indicate that a String (not Var) was read
}

else //is a numeric entry
{
loader_readVar=str_to_num(loader_readString); //convert to a var (numeric entry)
}

}
}

Re: Excel/OpenOffice as Gamedesign tool [Re: Damocles] #173694
12/19/07 02:21
12/19/07 02:21
Joined: Oct 2006
Posts: 175
G
Gumby22don Offline
Member
Gumby22don  Offline
Member
G

Joined: Oct 2006
Posts: 175
Thanks alot for that - I really like the idea, and will bookmark this one for later use.

Don
have a great day

Re: Excel/OpenOffice as Gamedesign tool [Re: Gumby22don] #173695
12/19/07 11:40
12/19/07 11:40
Joined: Sep 2005
Posts: 980
Aue, Sachsen, Germany
W
Wicht Offline
User
Wicht  Offline
User
W

Joined: Sep 2005
Posts: 980
Aue, Sachsen, Germany
A local SQL-Database is better than Excel/Calc/CSV.

I tried it with Microsoft Access and it's very cool.
The local Database-File (*.mdb) is also password-protected.

Re: Excel/OpenOffice as Gamedesign tool [Re: Wicht] #173696
12/19/07 12:19
12/19/07 12:19
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
But Excel has a better user interface for quickly changing inputs, marking them with colors, spell-checking
and using differnt Font-types.
All this makes working with data in "static" database Fields more convenient.

Re: Excel/OpenOffice as Gamedesign tool [Re: Damocles] #173697
12/19/07 12:22
12/19/07 12:22
Joined: Sep 2005
Posts: 980
Aue, Sachsen, Germany
W
Wicht Offline
User
Wicht  Offline
User
W

Joined: Sep 2005
Posts: 980
Aue, Sachsen, Germany
You are right but security is a big point.
Only a idea: It could be possible to combine a Excel-Sheet with a Access-DB.

Excel is the Interface and Access the data-pool.

Re: Excel/OpenOffice as Gamedesign tool [Re: Wicht] #173698
12/19/07 13:00
12/19/07 13:00
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
I agree.. Excel is a nice tool to manage these things, but in the end I want to protect the data so that it can't be modified by the user. By this, you have to write an additional data format or tool that converts the datasheet into embedded data or a protected data file.

@Wicht: do you use your access solution with GS? If yes, would you like to make an introduction in form of a short explanation?

Cheers,
Christian

Re: Excel/OpenOffice as Gamedesign tool [Re: HeelX] #173699
12/19/07 13:20
12/19/07 13:20
Joined: Sep 2005
Posts: 980
Aue, Sachsen, Germany
W
Wicht Offline
User
Wicht  Offline
User
W

Joined: Sep 2005
Posts: 980
Aue, Sachsen, Germany
PM'ed

Re: Excel/OpenOffice as Gamedesign tool [Re: HeelX] #173700
12/19/07 13:23
12/19/07 13:23
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
For hiding the code, I would write an importer/exporter sunction into 3dgs, that processes
the values in the arrays/strings.
This can be done for the release version, and is not really complicated.

For the development, Excel is a very flexible tool, since the data is easy to edit.
Every update just needs to be exported into that cvs file, and can then be loaded by the engine.

SQL ist more usefull for really! big Files, or dynamic online systems / servers.

Re: Excel/OpenOffice as Gamedesign tool [Re: Damocles] #173701
12/19/07 17:01
12/19/07 17:01
Joined: Aug 2002
Posts: 681
Massachusetts, USA
Ichiro Offline
User
Ichiro  Offline
User

Joined: Aug 2002
Posts: 681
Massachusetts, USA
For EoW (and others), we use Excel all the time. Typically, we'll have a Python script convert that data into something more directly C-Script readable (or even into C-Script, HTML, etc.). It's not a bad approach when used judiciously.


Dejobaan Games - Bringing you quality video games for over 75 years.
Re: Excel/OpenOffice as Gamedesign tool [Re: Ichiro] #173702
12/19/07 17:16
12/19/07 17:16
Joined: Jan 2003
Posts: 4,305
Damocles Offline OP
Expert
Damocles  Offline OP
Expert

Joined: Jan 2003
Posts: 4,305
You could also use the phython script to generate c-script Defines, this way saving
the need to create variables for several "static" values.
The values can be edited in Excel, but are fast static values in 3dgs.


Moderated by  checkbutton, mk_1 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1