Page 1 of 1

(DEMO INSIDE) GE's chronological order priority system

PostPosted: Mon Apr 21, 2008 5:43 pm
by stevenp
(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

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

PostPosted: Mon Apr 21, 2008 7:54 pm
by Troodon
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.

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

PostPosted: Mon Apr 21, 2008 8:03 pm
by stevenp
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

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

PostPosted: Mon Apr 21, 2008 8:26 pm
by Game A Gogo
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

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

PostPosted: Mon Apr 21, 2008 9:00 pm
by stevenp
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)

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

PostPosted: Tue Apr 22, 2008 1:45 am
by pyrometal
Interesting! As well as strange... I wonder why this is the case...

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

PostPosted: Tue Apr 22, 2008 3:36 am
by Game A Gogo
what I would like you to do, is monitor your CPU usage at the start of the game, and perhaps check if any relation

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

PostPosted: Tue Apr 22, 2008 3:49 am
by DST
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!

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

PostPosted: Fri Apr 25, 2008 1:16 am
by Game A Gogo
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

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

PostPosted: Fri Apr 25, 2008 2:09 am
by stevenp
what :? ?

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

PostPosted: Sat Apr 26, 2008 7:14 am
by DST
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.

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

PostPosted: Sun May 04, 2008 10:38 pm
by DST
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....