Jump to content


Schyler

Member Since 19 Jul 2006
Offline Last Active Sep 13 2015 01:09 PM

#4563512 Introduction To Binary

Posted by Schyler on 08 May 2014 - 10:45 PM

The last operator we want to look at is EOR (Exclusive OR, sometimes called XOR)

* The last operator we want to look at is XOR (Exclusive OR, never called EOR) ...

 

NPT below: I bet you feel dumb that none of those actually mention "EOR" except Wikipedia.


  • -1


#4527030 Fast Sine, Cosine And Tangent

Posted by Schyler on 17 March 2014 - 12:35 AM

The YYG runner has a very high instruction dispatch time and an even higher function dispatch time. The cost of calling the hardware sin/cos/tan is approximately 2 magnitudes smaller than either of these.

By attempting to "optimize" these, you're only slowing them down by increasing the amount of work the interpreter has to do. Essentially, more time is spent calling sin(x) than actually computing it, so caching its value is a useless "optimization".


  • 2


#4514108 Explode A String Into Two Lists. [Solved]

Posted by Schyler on 26 February 2014 - 09:27 AM

GML is not an object orientated language. You must assign the string to the result of string_delete, i.e.
 

LEADER_DATA = string_delete(LEADER_DATA, 1, DELIMITER_POS);

Documentation:

 string_delete


  • 1


#4508956 +1 To An Array Position

Posted by Schyler on 19 February 2014 - 01:26 PM

You have two options. The first option is to convert this whole schema into a ds_map, but the second (and by far simpler) is to just track the current level ID and increment it;

ie
levelID = 0;
currentLevel = obj_init.LevelTable[levelID, 0];
nextLevel = obj_init.LevelTable[levelID + 1, 0];
If this wasn't what you were looking for, maybe you should add some more information.
  • 1


#4508765 Similar Sequence Of Actions For A Few Objects?

Posted by Schyler on 19 February 2014 - 02:30 AM

If you want to extend upon functionality, you can use   :GM068:  to call the inherited event after you "overwrite" it.


  • 1


#4505544 Gmdeny Anti-hacker Protection

Posted by Schyler on 15 February 2014 - 03:25 AM

what if someone replace your dll with a do-nothing dll that export all your functions?
what if i hook your process and deny access to other processes?
too easy to bypass

You can defeat that by using it internally using the Extensions system.

This was a pretty weak attempt at an anti-hack. It's many years old now and unsupported because it was a step in the wrong direction.

Thanks for the necro though.
  • 1


#4500655 Gamemaker: Studio Bytecode Specification

Posted by Schyler on 09 February 2014 - 05:28 AM

With the release of the Early Access version of GameMaker: Studio, users can now disassemble their programs and view the underlying virtual machine bytecode.

I have documented a large portion of the bytecode to aid the public in understanding how GameMaker works internally and help optimize their applications.

You may find the documentation online: here

If you need to reference an instruction, you can obtain a permalink by looking it up in the table here.

Documenting the bytecode is still a WIP, so lots of instructions are still missing.
  • 8


#4496570 Why The Hell Is There An Objects Limit...

Posted by Schyler on 03 February 2014 - 09:06 AM

Just build an executable at home and run it at school?

Rant about something useful, like Obamacare.
  • -2


#4483220 [Request] Threads

Posted by Schyler on 16 January 2014 - 01:42 PM

<snip>

Okay, so I've taken a look into this at the request of @Phantom107.

Reverse engineering some of the interpreter I was able to track down `script_execute` (and add my own symbols).

gml_script_execute.png

I subsequently found a function returning whether a script existed and then was able to use references to the data structure which holds the scripts to in turn find the function which interprets a script. This is the function which could be called from another thread (spawned by a DLL) to emulate multitasking.

script_dispatch.png

I have a hunch that there are statics involved in the globals, but I haven't yet pulled out a debugger to check if that's the case (I'm a little busy with my own projects). In any case, if there are, then threading may well be impossible without binary patching a significant amount of the runtime.

If anyone is interested and also uses IDA, they can drop me a line -- I've reversed a significant amount of symbols which would help in producing new GMAPI-like functionality for GM:S.

Edit: The interpreter class pointer is in ecx. The comment shifted up a line.
  • 1


#4481505 Spawning Objects At Random Positions

Posted by Schyler on 14 January 2014 - 03:10 AM

You're not using random_set_seed in a step event, are you?
  • 1


#4480832 Physics - Item Falling And Rolling

Posted by Schyler on 13 January 2014 - 06:45 AM

use the angle_difference script to determine the shortest way to rotate to 0 when it hits the ground.
then simply roll it in that direction until the angle is close enough and then snap it to 0

 

That's going to look very strange if it's rolling one way and suddenly rolls the other.


  • 1


#4480831 Rooms & Views & Ports & Browsers Are Being Glitchy

Posted by Schyler on 13 January 2014 - 06:44 AM

<snip>

~ Thanks!  And please tell me if you want any more info.

 

It's not very easy for anyone to solve your issue as-is. Can you show us your view settings?


  • 1


#4480827 Physics - Item Falling And Rolling

Posted by Schyler on 13 January 2014 - 06:39 AM

Create:
move_towards_point(x-200+irandom(400),y-50-irandom(75),7);
gravity = 0.25;
gravity_direction = 270;
friction = 0.1;
 
// use random_range instead, to get a number between 1-3
spin = random_range(1,3);
 
Step:
// just adjust image_angle by spin directly
image_angle -= spin;
 
Collision:
// rather than setting the angle to 0, just stop it from spinning
spin = 0;
 
move_contact_solid(270,12);
vspeed = 0;
 
In the collision you can change
// for immediate stop
spin = 0;
// ... but to slow the spin down slowly. Adjust 0.1
spin = max(0, spin - 0.1);

  • 1


#4480814 Spawning Objects At Random Positions

Posted by Schyler on 13 January 2014 - 06:13 AM

Look at me having one of my stupid moments. XD

Thank you :)

 

Is there any way i can prevent them from spawning on top of other objects? I know game maker has a check free function but i've never used it before. :o

var xx, yy;
while (1) {
    xx = random(room_width);
    yy = random(room_height);
    // change obj_mbag here to `all` to check for all objects
    if (!position_meeting(xx, yy, obj_mbag)) {
        instance_create(xx, yy, obj_mbag);
        break;
    }
}
alarm[0] = 300

  • 1


#4480765 Spawning Objects At Random Positions

Posted by Schyler on 13 January 2014 - 04:32 AM

You're creating a obj_mbagspawn rather than an obj_mbag.

 

// change...
instance_create(random(room_width),random(room_height),obj_mbagspawn);
// ...to
instance_create(random(room_width),random(room_height),obj_mbag);

  • 1