Jump to content


Photo

Surface Fix


  • Please log in to reply
207 replies to this topic

#1 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 21 November 2009 - 03:10 PM

This package is no longer required for GM 8.1 users as 3D surface support was finally fixed by YYG. However, a new, separate package specifically for GM 8.1 users is being worked on which includes more advanced features.

Surface Fix (Version 1.2.1)

Surface Fix is an extension package/DLL for Game Maker 7 and Game Maker 8 that lets you easily and flawlessly use surfaces in your 3D games. No manual depth sorting needs to be done and no slow functions such as background_create_from_screen need to be used. Simply install the extension package or use the DLL and your game will instantly be able to use surfaces without problems in 3D mode.

Additionally, Surface Fix allows you to do the following:
  • Use room transitions in 3D games - even custom transitions will work without any modifications!
  • Draw to surfaces in the Draw event without messing up views
  • Quickly dump a surface to a string or file (to simplify saving surfaces with your games)
  • And more...
Plus, you can use it to add great-looking special effects to your games! Some of the effects that have been done so far include security monitors, mirrors, blur, motion blur, depth-of-field, glow, and shadows. Use your imagination and the possibilities are endless.

There is both a GEX version and a DLL version of the package. Also, a help file and five examples (security monitor, blur, motion blur, depth-of-field, and transitions) are included. Please read through the help file before you use it. Note that Windows Vista and Windows 7 users need to run GM as an administrator in order to install the GEX version of the package. I can't do anything about this, so don't complain. If you're unable to run GM as an administrator, use the DLL version instead.

Enjoy! :whistle:

License

Surface Fix is completely free. You may use it for both commercial and non-commercial purposes. If Surface Fix is used in a commercial game, you need to give me credit in some way. Otherwise, I don't really care.

Screenshot (from the monitor example)

Posted Image

Download

Extension package:
Posted Image

DLL:
Posted Image

Edited by amd42, 07 July 2011 - 12:37 AM.

  • 5

#2 wisemeat56

wisemeat56

    GMC Member

  • New Member
  • 180 posts

Posted 22 November 2009 - 02:17 AM

Hmm, I might try this! I'm downloading it right now.
  • 0

#3 wisemeat56

wisemeat56

    GMC Member

  • New Member
  • 180 posts

Posted 22 November 2009 - 02:23 AM

It's doesn't work. It says it can't find file Surface_Fix or something like that. ???

EDIT: And the moniter thing doesn't work either it says unknown function or script depth_clear.

EDIT 2: oops, didn't see that this was an advanced forum thread. Sorry! Probably why I can't understand this thing!

Edited by wisemeat56, 22 November 2009 - 02:27 AM.

  • 0

#4 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 22 November 2009 - 02:25 AM

I get an error saying "An error occurred installing the extension package." I think the file is corrupt or something.
  • 0

#5 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 22 November 2009 - 02:51 AM

I get an error saying "An error occurred installing the extension package." I think the file is corrupt or something.

That's odd - I just checked it and it installed fine. I'll re-upload it and see if that fixes anything.

EDIT: Okay, I re-uploaded it. Try it now and see if it works.

Edited by amd42, 22 November 2009 - 03:14 AM.

  • 0

#6 Jazza4Lyf

Jazza4Lyf

    GMC Member

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

Posted 22 November 2009 - 05:02 AM

[codebox]FATAL ERROR in
action number 1
of Step Event
for object obj_cam2:

COMPILATION ERROR in code action
Error in code at line 14:
depth_clear();

at position 2: Unknown function or script: depth_clear[/codebox]
I got this error after installing the package and running 'monitor.gmk' but it is fine with 'room_transitions.gmk', this could be very useful if it gets up and running.
  • 0

#7 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14396 posts
  • Version:GM:Studio

Posted 22 November 2009 - 06:35 AM

It works for me.

Now you are going to have to tells us how it works


Perhaps send the code to mark to see if he can natively suported it in GM8!
  • 0

#8 T-Bird

T-Bird

    GMC Member

  • New Member
  • 1326 posts

Posted 22 November 2009 - 07:00 AM

That is simply amazing.

Extensions like this always make me question how much of what Mark says he "can't do" for GM is simply a wont do. I have the upmost respect for him, but they need to hire some full time programmers to support him.

I must ask though, does this DLL overwrite GM's existing surface and transition functions to use surfaces controlled by your DLL? Does it tweak GM's internals? What is it doing?
  • 0

#9 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 22 November 2009 - 01:17 PM

That is simply amazing.

Extensions like this always make me question how much of what Mark says he "can't do" for GM is simply a wont do. I have the upmost respect for him, but they need to hire some full time programmers to support him.

I must ask though, does this DLL overwrite GM's existing surface and transition functions to use surfaces controlled by your DLL? Does it tweak GM's internals? What is it doing?

Thanks. Glad you like it.

I'm not going to go into too much detail here, but the only reason why surfaces don't normally work in 3D (Mark, take note!) is because surface_set_target() and surface_reset_target() set the ZBuffer to NULL. So, what the DLL in this package does is add code to a few of the surface functions to give each surface its own ZBuffer. Otherwise, most of the surface management is done by GM.

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?

Edited by amd42, 22 November 2009 - 01:18 PM.

  • 0

#10 HaRRiKiRi

HaRRiKiRi

    GMC Member

  • GMC Member
  • 1364 posts

Posted 22 November 2009 - 02:18 PM

This is nice. :D This also allows to create that sweet portal effect. While back we used the background save functions, but now it can be created in much faster way. :P

This really makes us think what Mark is doing all the time. By "cracking" GM, users have create some very unbelievable things and Mark couldn't do these things with the sourcecode he possess (like multi-threading). It just makes me sad. Anyway, he created a great language and it seems that open source projects like Enigma will be great replacements for this software that needs to be cracked all the time to make it better. :P

Edited by HaRRiKiRi, 22 November 2009 - 02:23 PM.

  • 0

#11 Whirligig

Whirligig

    GMC Member

  • New Member
  • 28 posts

Posted 22 November 2009 - 07:09 PM

Nice. I tried the security camera, and it works fine.

To those who were getting errors: Make sure you've installed the extension package before opening the other files.
  • 0

#12 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 22 November 2009 - 07:52 PM

I still get that same error. I tried installing it from another directory, but I sill get the error. I tried installing it on GM8 RC2 too, but even that gives the same error. Any help here? I was really looking forward to this.
  • 0

#13 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 22 November 2009 - 09:54 PM

I still get that same error. I tried installing it from another directory, but I sill get the error. I tried installing it on GM8 RC2 too, but even that gives the same error. Any help here? I was really looking forward to this.

You're doing this with Game Maker 7, right? Are you able to install other packages?
  • 0

#14 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14396 posts
  • Version:GM:Studio

Posted 23 November 2009 - 01:53 AM

I'm not going to go into too much detail here, but the only reason why surfaces don't normally work in 3D (Mark, take note!) is because surface_set_target() and surface_reset_target() set the ZBuffer to NULL. So, what the DLL in this package does is add code to a few of the surface functions to give each surface its own ZBuffer. Otherwise, most of the surface management is done by GM.

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?



So you've over ridden GM surface_set_target? made your own scripts with the same name so GM calls them (I like the fact that you can make script the same name as GM's and it calls them) and then they call a dll coded version, the dll packaged in the extention package? I asume.

Don't let us hanging. Share the concept.
  • 0

#15 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 23 November 2009 - 01:55 AM

I still get that same error. I tried installing it from another directory, but I sill get the error. I tried installing it on GM8 RC2 too, but even that gives the same error. Any help here? I was really looking forward to this.

You're doing this with Game Maker 7, right? Are you able to install other packages?

Yeah, I'm using 7. and I can install other packages perfectly.
  • 0

#16 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 23 November 2009 - 02:43 AM

I still get that same error. I tried installing it from another directory, but I sill get the error. I tried installing it on GM8 RC2 too, but even that gives the same error. Any help here? I was really looking forward to this.

You're doing this with Game Maker 7, right? Are you able to install other packages?

Yeah, I'm using 7. and I can install other packages perfectly.

Okay, try one more time. I made a few tweaks to the package and switched to a different file host. If this still doesn't work, I can just make a DLL out of it.

New Download Link
  • 0

#17 xot

xot

    media multimixer

  • Global Moderators
  • 4651 posts
  • Version:GM:Studio

Posted 23 November 2009 - 10:17 AM

This is straight-up AMAZING! You've just made my dreams come true, amd42. Bless you and the units of /dev/null!
  • 2

#18 Jazza4Lyf

Jazza4Lyf

    GMC Member

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

Posted 23 November 2009 - 02:49 PM

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?

Yeah, I re-downloaded it and it worked. Before I did, I made sure I checked and 'depth_clear()' was the only one that didn't come up in the info bar at the bottom nor was it highlighted like the other functions, but its cool now!

P.S. - REALLY like the monitor!
  • 0

#19 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 23 November 2009 - 08:46 PM

I'm not going to go into too much detail here, but the only reason why surfaces don't normally work in 3D (Mark, take note!) is because surface_set_target() and surface_reset_target() set the ZBuffer to NULL. So, what the DLL in this package does is add code to a few of the surface functions to give each surface its own ZBuffer. Otherwise, most of the surface management is done by GM.

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?



So you've over ridden GM surface_set_target? made your own scripts with the same name so GM calls them (I like the fact that you can make script the same name as GM's and it calls them) and then they call a dll coded version, the dll packaged in the extention package? I asume.

Don't let us hanging. Share the concept.

It just alters the code of those functions directly - when the game loads, an initialization function is called which changes a few bytes in the surface functions so that they branch into some C++ code at certain points. It doesn't replace them - they're mostly left intact, aside from the few changes that the DLL makes. This is also why it only works with GM7 - I used hardcoded memory addresses which code is written directly into. It's faster (and in some cases, easier) than completely rewriting all of the surface functions. I'm going to make this open-source soon, so you'll see what I mean.

Edited by amd42, 23 November 2009 - 08:51 PM.

  • 0

#20 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 23 November 2009 - 09:08 PM

I'm not going to go into too much detail here, but the only reason why surfaces don't normally work in 3D (Mark, take note!) is because surface_set_target() and surface_reset_target() set the ZBuffer to NULL. So, what the DLL in this package does is add code to a few of the surface functions to give each surface its own ZBuffer. Otherwise, most of the surface management is done by GM.

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?



So you've over ridden GM surface_set_target? made your own scripts with the same name so GM calls them (I like the fact that you can make script the same name as GM's and it calls them) and then they call a dll coded version, the dll packaged in the extention package? I asume.

Don't let us hanging. Share the concept.

It just alters the code of those functions directly - when the game loads, an initialization function is called which changes a few bytes in the surface functions so that they branch into some C++ code at certain points. It doesn't replace them - they're mostly left intact, aside from the few changes that the DLL makes. This is also why it only works with GM7 - I used hardcoded memory addresses which code is written directly into. It's faster (and in some cases, easier) than completely rewriting all of the surface functions. I'm going to make this open-source soon, so you'll see what I mean.

Good! Then I can finally use it ;) (If you don't mind releasing the .ged)
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users