Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, alibaba, Quad), 761 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
What is the gamestudio Workflow? #184796
02/20/08 15:14
02/20/08 15:14
Joined: Feb 2008
Posts: 23
Sjlver Offline OP
Newbie
Sjlver  Offline OP
Newbie

Joined: Feb 2008
Posts: 23
Hello

I'm looking for documentation of the gamestudio workflow. I tried to read tutorials, but they all seem to start with some level / project files already available, and I'm a bit lost trying to create a new project myself. Is there any documentation describing how to create a simple project from scratch?

For the beginning, that's what I'd like to do:

- Create two objects, a sun and a planet.
- Have the planet orbit about the sun on an elliptical curve, something like
xPlanet = a * cos(omega * t);
yPlanet = b * sin(omega * t);
where omega is the speed and a, b, the two half-axes lengths of the ellipse. t represents the time, preferably in some uniform unit (not necessarily frames cause the framerate might not be constant).

That's all already, I'd be happy if I get this simple setup working.

The various questions that pop up
- What are the sun and the planet? Objects in the OO-sense? Models or Map Entities? Something else?
- Do I have to program a gameloop somewhere to call a function which updates the position of my planet? Or is this done by Gamestudio?
- Where goes the code for my planet? How do I link it to the planet and who calls it/when does it get called?
- Is it possible to create class hierarchies? Does this make sense for 3DGS? I imagine something like having a general SpaceObject with position, velocity, acceleration etc. Planet (and later SpaceShip, Asteroid, ...) would herit from that class.

As you can see, I come from a more traditional programming background and have no idea about the "point-and-click" way of game creation with 3DGS. I'm happy for any pointers!

Thanks and cheers
Jonas

Re: What is the gamestudio Workflow? [Re: Sjlver] #184797
02/20/08 19:00
02/20/08 19:00
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Did you already read your way throuhg the workshops?(http://www.3dgamestudio.com/download.php)

Other than that, I think that you should use models for the sun and the planet. Just create a new empty level in WED and place them in there. Save the level in a new folder somewhere on your hdd. Then go to file->map properties, click on the new button next to the field titled main script (or something like that) and choose "empty script".
This creates a new, empty script named "Levelname.wdl". If your are using A7, you should rename it to "Levelname.c" and change this in the map properties.
Now open that file with SED and write in the mainfunction which will just load your level at the moment and the needed headers:
Code:

#include <acknex.h> //needed when using GS A7
#include <default.c> //not needed, but implements some usefull debugfunctions

void main()
{
level_load("Levelname.wmb");
wait(3);
}


If you now build and run your level in WED it will compile and run this script.
You will be able to move around in your level after pressing 0 with WASD/Arrows and the mouse. Press F11 for the debugpanel, f5 for changing the resolution, f6 for taking a screenshot, alt+enter to toggle between windowed and fullscreen.
You should be able to move around and find your models somewhere .

Now you should adjust the displayingsettings for the "gamestart". Just add the following two lines in front of the level_load:
Code:

var video_screen = 1; //1 for fullscreen, 2 for windowed
var video_mode = 8; //8 for 1024*768, 7 for 800*600, 6 for 640*480 and so on



Just look them up in the manual for more information. To change it at runtime use video_switch or video_set.

Now you need the actions for your planet and the sun. They are ordinary functions but can be choosen in WED and assigned to your models there.
Just add the following lines to your script:
Code:

ENTITY* Sun_ent;
action Sun_act()
{
Sun_ent = my;
}

action Planet_act()
{
while(1)
{
my.pan += 5*time_step; //turn the model around itself
wait(1) //wait until the next frame
}
}



Now reload your Level into WED, righclick the sun, choose "Behaviors" (or choose Properties and go to the behaviors tab) and assigned Sun_act to it.
Do the same for the planet. Build and run your level. It should be the same as before but with the planet turning around itself.
It should be quite easy for you now to make the planet move around the sun.
You can access the planet within the action through the my-pointer
-> change its position through changing my.x/my.y/my.z and its rotation through changing my.pan/my.tilt/my.roll.
Because Sun_act assigns the my pointer to Sun_ent you also know everything about the sun (Sun_ent.x/Sun_ent.y/...) and can now place the planet depending on that.

I hope this helps you a bit to get started
Slin

Re: What is the gamestudio Workflow? [Re: Slin] #184798
02/20/08 21:07
02/20/08 21:07
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline
User
MrCode  Offline
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
Quote:


t represents the time, preferably in some uniform unit (not necessarily frames cause the framerate might not be constant).





That's what multiplying t's rate of change (t+= n;, where n is the rate of change) by the variable time_step is for.

Re: What is the gamestudio Workflow? [Re: MrCode] #184799
02/21/08 01:15
02/21/08 01:15
Joined: Feb 2008
Posts: 23
Sjlver Offline OP
Newbie
Sjlver  Offline OP
Newbie

Joined: Feb 2008
Posts: 23
Hi Slin! Amazing... now I understand why people told me 3DGS has a great community. I'll try your hints today, and might come back with more questions.

Thanks to everybody
Jonas

Re: What is the gamestudio Workflow? [Re: Sjlver] #184800
02/21/08 07:35
02/21/08 07:35
Joined: Feb 2008
Posts: 23
Sjlver Offline OP
Newbie
Sjlver  Offline OP
Newbie

Joined: Feb 2008
Posts: 23
OK, this works indeed, although I had to overcome some quirks of 3DGS to make it work. They are described here so other people don't repeat them...

WED won't find models that are not in the same directory than the level. Since the level is in no directory before being saved, it won't find any models until you save the level.

How come you have to reload the level in WED for it to recognise new behaviours? That's why I always had an empty list there...

It's just video_mode = 1;, without the var. You don't want to declare those as local variables, but change their value so level_load behaves correctly. I assume this is the way to configure 3DGS? By assigning values to global variables?

Cheers,
Jonas

Last edited by Sjlver; 02/21/08 07:46.
Re: What is the gamestudio Workflow? [Re: Sjlver] #184801
02/21/08 17:27
02/21/08 17:27
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Quote:


WED won't find models that are not in the same directory than the level. Since the level is in no directory before being saved, it won't find any models until you save the level.




You can go to "object -> load entity", choose the filetype (mdl for models, hmp for terrains, ...) and load a model from any folder you wish. This will copy the model into your projectfolder and load it into WED.

Quote:


How come you have to reload the level in WED for it to recognise new behaviours? That's why I always had an empty list there...




I don´t know but I think that WED goes through the scripts when loading the level to search for such keywords as action, effect, ... . It just doesn´t do it all the time you modify the Scripts. But you could also type in the actions name without reloading. It is less comfortable, but works as well.

Quote:


It's just video_mode = 1;, without the var. You don't want to declare those as local variables, but change their value so level_load behaves correctly.




I mixed it up with the old c-script. You had to declare them there, global

Quote:


I assume this is the way to configure 3DGS? By assigning values to global variables?




You can do it this way at gamestart, but will have to call the functions (f.e. video_switch) for it later on.

Re: What is the gamestudio Workflow? [Re: Sjlver] #184802
02/21/08 18:07
02/21/08 18:07
Joined: Feb 2008
Posts: 21
J
jonkuhl Offline
Newbie
jonkuhl  Offline
Newbie
J

Joined: Feb 2008
Posts: 21
Quote:


How come you have to reload the level in WED for it to recognise new behaviours? That's why I always had an empty list there...




Right click your entity
Hit "Behavior"
If the list comes up blank, simply type the name of the action in.

Save your script, save wed, update entities and test run it.


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