(DEMO INSIDE) GE's chronological order priority system

Talk about making games.

(DEMO INSIDE) GE's chronological order priority system

Postby stevenp » Mon Apr 21, 2008 5:43 pm

(DEMO IS IN POST 5)

i was just wondering if anyone knows how the GE's priority system works

every single actor has the "create on start up" feature

so what if i do this EXAMPLE


(edited)
on start up make actor's mojo VAR varible = 1
on start up make actor's domo VAR varible = 2
keep in mind it is the same variable, just in diferent actors

if all actors are created on start up, all the code will try to be competing against eachother

i am guessing the GE system has a kind of "priority" sequence detection that can distinguish between these kinds of things,

my guess was, what ever actor was created last, or variable that was created last, gains priority, and will be used

this can also be related to Z depth by default all actors start with Z depth of 50%, markslane could have made a hidden thing like 50% (+1) for every actor that is created after the last

i am not having any problems with this, i am just curious to how it works
Last edited by stevenp on Tue Apr 22, 2008 2:36 am, edited 4 times in total.
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: (discussion) GE's chronological order priority system

Postby Troodon » Mon Apr 21, 2008 7:54 pm

As far as I've noticed GE (and the other programs too) read the code from left to right and from up to down.
So the chronological order is from the line 1 to line 2 etc. :)

myvar = 15;
myvar = 17;
myvar = 3;

Would make myvar into 3.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Re: (discussion) GE's chronological order priority system

Postby stevenp » Mon Apr 21, 2008 8:03 pm

tekdino wrote:As far as I've noticed GE (and the other programs too) read the code from left to right and from up to down.
So the chronological order is from the line 1 to line 2 etc. :)

myvar = 15;
myvar = 17;
myvar = 3;

Would make myvar into 3.



i already know that but i mean if you have 2 different actors, with that variable it gets created all at the same time

its like

in 10 seconds make actor's mojo VAR varible = 1
in 10 seconds make actor's domo VAR varible = 2

keep in ind it is the same variable, just in diferent actors
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: (discussion) GE's chronological order priority system

Postby Game A Gogo » Mon Apr 21, 2008 8:26 pm

the CPU can only do one line at a time.
the time that it takes to compute that time is called a CPU cycle
CPU cycle are measured in hz, the bigger it is, the less time it takes, just like sound, the more hz frequency is high, smaller the curve's width will be.

So it is true that it will go from up to down.
let say something like this:
Code: Select all
Var1=0;
Var1=10;

at then end, var1 would be 10, if it would be reversed, it would be 0.

and so is it for left to right.
Code: Select all
var1=10;

makes more sense then
Code: Select all
10=var1;

as it needs to identify where it writes. if for some reason, it would be the other way, it would need to create a temp var, which would use memory uselessly, and then assign that temp var to the current one. too much CPU handling for no reason, and as well as memory usage.

But for the priority, I think it is based on the size of the graphic, for the creation at least.

What you should try is having like 2 actors, one with var=1; and the other with var=2; at startup. and make a text actor that displays what the var is. try doing it with different events, like type of actor, useless computing etc
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: (discussion) GE's chronological order priority system

Postby stevenp » Mon Apr 21, 2008 9:00 pm

ok i made a demo, the funny thing is, every time you pres the GAME MODE button, the numbers change
( try it like 10 times )

sometimes the 2 bottom numbers are 1 or 5

( bottom numbers are dependant on the top)
Attachments
random choosings.zip
(197.65 KiB) Downloaded 100 times
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: (DEMO INSIDE) GE's chronological order priority system

Postby pyrometal » Tue Apr 22, 2008 1:45 am

Interesting! As well as strange... I wonder why this is the case...
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: (DEMO INSIDE) GE's chronological order priority system

Postby Game A Gogo » Tue Apr 22, 2008 3:36 am

what I would like you to do, is monitor your CPU usage at the start of the game, and perhaps check if any relation
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: (DEMO INSIDE) GE's chronological order priority system

Postby DST » Tue Apr 22, 2008 3:49 am

The first test is to check it in exe format. The GE game mode is a quick compile, and is not the same as the exe version. But yes, I found the same issue that you had, this one involved Zdepth.....every time I'd open the file, they would spawn in....EXACTLY THE OPPOSITE order!
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: (DEMO INSIDE) GE's chronological order priority system

Postby Game A Gogo » Fri Apr 25, 2008 1:16 am

one theory solved :D

EDIT: and I know why it's like that.
It needs to draw the back layer before the top layer, so it can overlay. it's just like pasting stickers on a board, you can't place one under another after it's placed :P
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: (DEMO INSIDE) GE's chronological order priority system

Postby stevenp » Fri Apr 25, 2008 2:09 am

what :? ?
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: (DEMO INSIDE) GE's chronological order priority system

Postby DST » Sat Apr 26, 2008 7:14 am

no it was worse than that.....every time i used the file the order would reverse....from the previous time. This means there is no way I can change the code to fix it without using a delay of some sort....but still it can be done.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: (DEMO INSIDE) GE's chronological order priority system

Postby DST » Sun May 04, 2008 10:38 pm

I think I understand it now. When u have actors with many properties, accessing many variables, you create a huge web of linking. Because data is stored in arrays, it has to load them one by one. It loads things in a logical order but it's not what you expect, because you are human and use human logic.

Here is an example:
I have fifty actors that load when the game loads. Each of these actors has a few variables to be loaded as well;
Transp, health, cancollide, xy coordinates, rbg values, createactor events....
How would you load those if you were a cpu? Load the health for each actor, then load the transp for each actor?
or load each actor one by one and all its variables as its loaded? That could mean accessing an array 100's of times in no chronological order. You might compare it to a search engine; how to rank pages based on content? There is no perfect answer. Google is very good at sorting pages, but it often messes up my search results too.

Things have to be loaded in a logical mathematical order, and the decisions of who gets what first are ideally arranged in an efficient way for the cpu to work them. But your game is not so ordered...and that's good, because if you arranged it in perfect mathematical sense, your game wouldn't be much fun. Its the creativity that u put into ur game that makes it FUN!

And math, and perfect order.....aren't often fun!

Another note about chronological order is that there is a huge difference between 'game mode' in GE and starting an EXE file;
When you doubleclick an exe, all the arrays and structs and images are loaded right then and there.
When you click 'game mode' in GE, all your arrays and structs...are ALREADY there. You've had it open for half an hour!
The data you've added since you opened the GED file is, technically, the NEWEST data in the arrays and structs.
But in the exe file, there was nothing there before you started it...so there is no newest and oldest.

I hope this helps....
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron