Jump to content


Photo

Command Stack usage in GMS


  • Please log in to reply
57 replies to this topic

#1 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 01 May 2012 - 07:25 PM

this? Hello, I've gotten to depending on the command stack setup from-
http://gmc.yoyogames...opic=335600&hl= command stack&st=0

-and from the get go in GMS it has been nonfunctional while either causing a fatal crash or just not seeming to execute is any meaningful way. No flag info is generated to debug with in either case ( that I know of, which doesn't mean much IMO) . So guys am I dense or is it a change in data structures/calls or a simple runner bug causing this? BTW it does work on HTML5 but thats presumably from the Delphi runner still being in use there.
  • 0

#2 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 01 May 2012 - 09:34 PM

It was broken in HTML5 and they fixed it. Please report the problem for Studio.
  • 0

#3 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 03 May 2012 - 10:59 PM

Well Shucks, what am I supposed to report dosnt work?
  • 0

#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 04 May 2012 - 01:03 AM

I got the latest studio and it does work on windows and on htlm5 output.
  • 0

#5 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 04 May 2012 - 02:56 AM

Really? I'm on the beta updatde channel and its not working... (the code doesnt throw an error, but no actual behavoir occurs) Perhas this is a case of forced reinstall needed?
  • 0

#6 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 04 May 2012 - 03:07 AM

Just unintalled, reinstalled studio... No change, windows/Android version of project does not react.
  • 0

#7 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 04 May 2012 - 03:18 AM

Just unintalled, reinstalled studio... No change, windows/Android version of project does not react.


Well, you say windows... Like I said, I tried it under windows and HTML5 (not android) and it works.


Open Studio, import the demo (commandstack.gmk). runs fines here.
  • 0

#8 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 04 May 2012 - 07:29 PM

Thats including windows, E.I when you say it works are the arrows on screen moving?
  • 0

#9 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 04 May 2012 - 08:14 PM

Thats including windows, E.I when you say it works are the arrows on screen moving?


Yes and the ai is chasing and eating the other guys. and the tank rooms work too,
  • 0

#10 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 04 May 2012 - 10:05 PM

This is interesting...
I just did a clean GMS install on my laptop (has not had GMS on it till now) updated GMS and still no functionaliy of commandstack.gmk outside HTML5 ...
Either you are doing someting very right or I am doing osmething very wrong here...
My GMS list version as 1.0.153 (r11948) Is this somehow not the version you are using?
  • 0

#11 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 04 May 2012 - 11:42 PM

Same version.

These bugs are almost impossible to figure out unless the person who experiences it (on his machine) is skilled enough to debug it. And it's not easy to debug someone else's stuff.

If you could use show_debug_message() starting from the top functions and pin point where it's failing...

top of function
show_debug_message("Enter: FunctionName")
...code

bottom of function, before the return statements
show_debug_message("Exit: FunctionName")
  • 0

#12 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 05 May 2012 - 12:18 AM

Ok nice! Thanks icuured, I can see now that the "CommandsPerfom" script is not completing for whatever reason..... I should note that I am refering to a freshly downloaded and otherwise unmodified version of the commandstack tutorial... So there is no code of mine at work here. I do wish someone else could verify this behavior as being uniqe to my household here or rather it working for you is.
  • 0

#13 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 05 May 2012 - 04:36 AM

Scratch that, doesnt seem to be the case...... What the heck is going on here?
  • 0

#14 NakedPaulToast

NakedPaulToast

    GM Studio/Mac/Win

  • GMC Member
  • 8238 posts
  • Version:GM:Studio

Posted 05 May 2012 - 05:14 AM

I downloaded the .gm81 version, and imported it into GM:S 1.0.153

It worked perfectly with the HTML5 export, with the Blue AI object immediately hunting down the Red enemies.

With both the Windows and Android exports, the screen froze immediately when running, with the Blue AI object and all visible Red enemies frozen with their directional arrows pointing right.
  • 0

#15 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 05 May 2012 - 05:24 AM

That is way bizarre. Are the functions even called? With a show_message you can detect what function blows the whole thing to bits. You can also enable the error save log in the game settings. show_debug_messages are logged there too I think.
  • 0

#16 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 05 May 2012 - 06:12 AM

+1 ^ Thats what I get on my machines as well!

Edited by lordvtp, 05 May 2012 - 06:13 AM.

  • 0

#17 rwkay

rwkay

    YoYo Games CTO

  • YoYo Games Staff
  • 2314 posts
  • Version:Unknown

Posted 05 May 2012 - 08:56 AM

Currently GML in extensions will not be working (though DLL's are in the next version, coming soon) - can you file a bug with a project attached and I will take a look.

Russell
  • 0

#18 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 05 May 2012 - 03:26 PM

This is made in GML and simply uses ds_list, ds_stack and script execute. and user defined command scripts do use other functions, if it gets that deep in the calls.

I don't know where the fault would happen or why it would glitch only for some. Especially in Windows

Added to bug tracker
  • 0

#19 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 21 May 2012 - 10:45 PM

Sorry to necro this, but what bug # did this get? I'm just wondering if its been assigned or passed off, as are allready on the 2nd release candicate and still no dice for this.

Edited by lordvtp, 21 May 2012 - 10:46 PM.

  • 0

#20 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 21 May 2012 - 11:22 PM

Sorry to necro this, but what bug # did this get? I'm just wondering if its been assigned or passed off, as are allready on the 2nd release candicate and still no dice for this.


Studio Database, #3181
http://bugs.yoyogame...iew.php?id=3181
  • 0

#21 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 21 May 2012 - 11:56 PM

Thanks man!
  • 0

#22 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 25 May 2012 - 04:08 PM

It looks like it wont be fixed. They closed it with the last comment

>>Until you can give a succinct example that exhibits the problem I cannot wade through all this code.


Basically they are asking us to debug their problem for them. In a way, they don't really have a choice in the matter. However I would have liked for them to have said something like

>>We ran it on all the machines we have and it works fine so like you said it's a difficult problem to resolve

A little less "Not our problem" slap in the face.

So it's up to the people that have the problem to try to pin point what the cause is.

I suggest you do what I said in post 11


and for all the user commands, like PatrolTo, you simply do a

show_debug_message("ScriptName"); return 1;


this will at least eliminate any user code problems from the equation. You said the problem is in CommandsPerform. so if you could narrow it dow by putting more show_debug message...

show_debug_message("CommandsPerform ENTER")
show_debug_message("CommandsPerform CHECK1")
if(m_cmdstkscripts = -100) return 0;
if(m_cmdstkdata = -100) return 0;
if(m_cmdlstscripts = -100) return 0;
if(m_cmdlstdata = -100) return 0;

//Call this in your step event
//you may check the return code
//wich will be 0 when all commands have run
//in oder to re-add the default behaviour of your AI.

//if(!CommandsPerform())
//{
//    CommandListAdd(PatrolToXY,...);
//}

show_debug_message("CommandsPerform CHECK2")
if(!ds_stack_size(m_cmdstkscripts)) 
{
show_debug_message("CommandsPerform CHECK2.1")
    if(!ds_list_size(m_cmdlstscripts)) return 0;
show_debug_message("CommandsPerform CHECK2.2")
    if(!ds_list_size(m_cmdlstdata)) return 0;

show_debug_message("CommandsPerform CHECK2.3")    
    ds_stack_push(m_cmdstkscripts,ds_list_find_value(m_cmdlstscripts,0));
show_debug_message("CommandsPerform CHECK2.4")
    ds_stack_push(m_cmdstkdata,ds_list_find_value(m_cmdlstdata,0));
show_debug_message("CommandsPerform CHECK2.5")
    if(ds_list_size(m_cmdlstscripts))
        ds_list_delete(m_cmdlstscripts,0);
show_debug_message("CommandsPerform CHECK2.6")
    if(ds_list_size(m_cmdlstdata))
        ds_list_delete(m_cmdlstdata,0);
}


var data;

show_debug_message("CommandsPerform CHECK3")

if(!ds_stack_size(m_cmdstkdata)) return 0;
show_debug_message("CommandsPerform CHECK4")
if(!ds_stack_size(m_cmdstkscripts)) return 0;

show_debug_message("CommandsPerform CHECK5")
data = ds_stack_top(m_cmdstkdata);
var res;
show_debug_message("CommandsPerform CHECK6" + script_get_name(ds_stack_top(m_cmdstkscripts)))
res = script_execute(ds_stack_top(m_cmdstkscripts), data)
data.action = 3;
if (res = 0) return 1;
show_debug_message("CommandsPerform CHECK6")
CommandStackPop();
show_debug_message("CommandsPerform CHECK7")
if(res = -1) return CommandsPerform();
show_debug_message("CommandsPerform EXIT")
return 1;

  • 0

#23 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 25 May 2012 - 08:47 PM

All right, guess I have no choice. It really is surprising how the was disregarded as any intermittent bug that is also machine specific makes it very hard to 'prove' the existence to a remote party... What do they want a youtube vid showing it not running? Furthermore this is no longer a beta or a purely educational tool anymore, this is support for a paid product for commercial development purposes.


Perhaps we should compare environments/setups between with working/non working users. I have two main PC's (A laptop and a desktop) Both are win7-x64 (one ultimate/one premium) Both have the latest Dx and VB runtimes installed for game usage. Both are nvidia based graphically. This run on neither machine.

I'm going to start adding the debug lines to the stock version of Commandstack since I don't want any problems with my projects diluting the results.
  • 0

#24 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 25 May 2012 - 09:07 PM

Ok, this is what I'm seeing in my compile window.
"
CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6DriveToXY
CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6DriveToXY"
rinse and repeat
  • 0

#25 Mike.Dailly

Mike.Dailly

    Evil YoYo Games Employee

  • Administrators
  • 3260 posts
  • Version:GM:Studio

Posted 25 May 2012 - 09:13 PM

Oh come on, get real. This would take a long time to debug in its current form, time that could be spent on MANY other bugs. We get a huge number of issues that either give NO example, or full games with comments - it's broken somewhere, fix it. 9 times out of 10, it's the game code that's at fault.

We've said before, this is a new runner, and the order of things have changed. This means old stuff may not work. This is not a bug. It's just the way things now work.

However... if you can point to a specific place, with a specific bug, we'll happily fix it. But asking us to debug a large system simply isn't going to happen, and I'm amazed you think it would.

We're not saying there's no bug, we're saying there's too much code for use to debug in a reasonable time frame. The elements listed are used by us and MANY others properly, so we have no reason to believe they are fault. That said, edge cases can ALWAYS happen, but for this to be found, you need specific cases, not a general "this doesn't work". Find the edge case, and we'll fix it.
  • 0

#26 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 25 May 2012 - 10:55 PM

If I had some idea as to what/why/where the reasons this does not work as intended, I wouldn't need a bug report. If have yet to find any actionable information as to the nature of the fault. Even in the early beta the best I could Get was a hard crash with NO data generated by the crash. Indeed this is a different runner, and in some way probably dealing with data structure handling, variable handling what have you... What is not operating correctly lies at the runner level and is not exposed. If there are undocumented changes to the supported data structs that is not something we can just 'fix' and is not going to be apparent.

I can only assume since it was deemed 'no example, not reproducible' that the code works as described in your systems. The very fact that the same code does NOT behave identically with a given runner on different systems should be a major red flag. Were this a question of one system or user having this occur the course of action would be so much simpler.

Edited by lordvtp, 25 May 2012 - 10:56 PM.

  • 1

#27 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 25 May 2012 - 11:00 PM

Chill mike. I stated in tracker that I could not make the thing simpler and that it would be quasi impossible to debug if you don't have the problem on your end. It's a complex problem we are having here. A WTF moment that only happens on some machines. Of course the Studio Product will be pointed too first as the thing works on all other GM versions including GM::HTML5 and Studio but not for this guy. The demo works, I can't simplify it more than that..

Perhaps you can peruse discretely as I remote debug this thing. See what someone with 20+ years experience in debugging can do....

@lordvtp. OK, I'm doing this drunk so bare with me...

Your output is promising, at least it shows it's not locked and it's actually doing something and that is good. This shows the program at least finds a script to run (MoveToXY)... And since you say the AIs don't move then at least we are almost on the verge to finding the problem


The problem must be arround this code or in MoveToXY itself
data = ds_stack_top(m_cmdstkdata);
show_debug_message("CommandsPerform CHECK6" + script_get_name(ds_stack_top(m_cmdstkscripts)))
IT GOT THIS FAR
add this right after
show_debug_message("CommandsPerform CHECK6.2 data is" + string(data))

but did it execute THIS!??
res = script_execute(ds_stack_top(m_cmdstkscripts), data)
add right after
show_debug_message("CommandsPerform CHECK7 " + script_get_name(ds_stack_top(m_cmdstkscripts)) + " returns " + string(res))

to see if the code proceeds on after the call and to see if res is set to the return specified by the call

I assume you did not put
show_debug_message("MoveToXY ENTER")
at the top of the MoveToXY script as I said in my other post, because we should see a
MoveToXY ENTER entry in the debug output... If you did add it then the problem is definitely on the
res = script_execute(ds_stack_top(m_cmdstkscripts), data)
line.


Anyway, for now, here is the movetoXY debug version...
show_debug_message("    MoveToXY ENTER")

//CommandStackPush (MoveToXY, destx, desty, speed)
//This command will move to the destination point, 
//it will slow down when it gets close to the destination if
//the speed would make it jump over the destiantion and then stop
//data.arg1 = x;
//data.adr2 = y;
//data.arg3 = speed;

//return 0 when not done, 1 when done, -1 when done and hurge to proceed with the next event right away

//A data objects is provided to store your information for the command
var data;
data = argument0;

//A flag tells you if you are initializing, 
//starting the action, 
//continuing the action 
//or done with the command
if(data.action = 0) //pushed (added to stack)
{
show_debug_message("    MoveToXY Push, data is : " + string(data))
    //init vars/create stuff
    data.TargetX = data.arg1;
    data.TargetY = data.arg2;
    data.MoveSpeed = data.arg3;
show_debug_message("    MoveToXY Push EXIT with 1"))
    return 1;
}
else if(data.action = 1) //poped (removed from stack)
{
    //done... free stuff
show_debug_message("    MoveToXY Pop EXIT with 1"))
    return 1;// done
}
else if(data.action = 2) //first actual "perform the action" call
{
    //start performing
show_debug_message("    MoveToXY Start Perform Command"))
}
else if(data.action = 3) //subsequent call
{
    //keep performing
show_debug_message("    MoveToXY Still Perform Command"))
}


//start/keep performing it is then...
pd = point_distance(x,y,data.TargetX,data.TargetY);
show_debug_message("    MoveToXY Distance is " + string(pd)))

if(pd = 0) 
{
    speed = 0;
show_debug_message("    MoveToXY Distance Reached, EXIT return -1")
    return -1;
}

show_debug_message("    MoveToXY move_towards_point at speed " + string(min(data.MoveSpeed,pd)))

move_towards_point(data.TargetX,data.TargetY, min(data.MoveSpeed,pd));

show_debug_message("    MoveToXY EXIT return 0")
return 0;// not done


Please report back with the new output. This should show if script execute is working, if the data instance is valid, if the arguments are passed, if the return is passed on, if the point_distance is working....

I appreciate your help on this
  • 0

#28 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 25 May 2012 - 11:16 PM

Ok, Changes to MoveToXY have been made but.....

Output is identical to before! none of the new debug msgs show up!
  • 0

#29 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 26 May 2012 - 04:01 AM

I'm back from the bar...
OK, now double check by calling the script directly...

change
res = script_execute(ds_stack_top(m_cmdstkscripts), data)

to
res = MoveToXY(data);

then to
res = script_execute(MoveToXY,data);

See if one of them works calling the MoveToXY

I'm starting to suspect script_execute a little....
data could also be the cause...

If I'm right you should see the debug messages in the first change but not after the second change

[edit] typos and code changes
  • 0

#30 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 626 posts
  • Version:GM:Studio

Posted 26 May 2012 - 04:13 AM

Ok!

When Doing res = MoveToXY(data);

CommandsPerform ENTER
CommandsPerform CHECK1
CommandsPerform CHECK2
CommandsPerform CHECK3
CommandsPerform CHECK4
CommandsPerform CHECK5
CommandsPerform CHECK6PatrolToXY"
MoveToXY ENTER
MoveToXYStill Perfom Command
MoveToXY Distance is 390.61
MoveToXY move_towards_point at speed 0
MoveToXY EXIT return 0



When Doing - res = script_execute(data);



ERROR in
action number 1
of Step Event0
for object EnemyAIObj:

Trying to execute non-existing script.


I state again that I have changed no other code or scripts then you have specified!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users