Pages: 1
Author Topic: Ultimate3D 2.1 Ported  (54,741 Views)
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Posted on: May 17, 2013, 05:19:08 PM


If some of you are not aware, Ultimate 3D is an API which provides extended and advanced graphics for GameMaker. After some requests I decided to check out getting the SDK example working with ENIGMA. This extension should be built into ENIGMA's extension system instead of the way it currently is, then you wouldn't need to import all those scripts that make the dll callbacks. We could also make a special graphics system for extensions like this which completely disable all graphics output by ENIGMA to make it more optimal than the GM version. This only works on Windows because the extension is based on Direct3D if anyone wants to try it out.

Getting this work required a fix in our window flags which you can obtain from Git or you can simply update to the latest Portable ZIP.
https://github.com/enigma-dev/enigma-dev/pull/884

Download the new Portable ZIP here if you don't want to update manually:
http://enigma-dev.org/docs/Wiki/Install:Windows

Enter the following in a terminal or with git-bash.exe if you have the Portable ZIP and want to update manually (you may also need to download the new LGM and plugin jars):
Code (Bash) Select

cd enigma-dev
git fetch
git pull


The rest of the porting required removing variable_local_* and variable_global_* function dependence. For Ultimate3DOptions I wrapped the variable initialization in a global.ultimate3d_key_initialized flag to emulate the previous behavior. I have removed the variable initialization for CreateWall or CreateFloor because the user is expected to do it anyway, so I see no reason why this was necessary as it would just make the object invisible if they were not initialized, these really should have just parameters to the scripts. This also requires that "Treat unitialized variables as 0" is enabled in Game Settings->Errors

This is the updated CreateWall() script for instance. I hope these changes are correct and that the original creator would agree with them, since something similar would be necessary to port it to Studio anyway.
Code (EDL) Select
// CreateWall()
// This function creates a wall object and associates it with the object
// the function is called by. Before you can call this function you have
// to set the variables x2 and y2 which define where the wall goes to
// from it's origin, the variable height which defines the height of the
// wall and the variable texture which gives the index of the texture that
// is to be used for the wall. For information on optional variables and
// more information on how to use primitive objects read the help file.
Init();
InitializePrimitiveVariables();
/*
if (!ultimate3d_createwall_initialized) {
ultimate3d_createwall_initialized = true;
x2=0;
y2=0;
height=0;
}
*/
u3d_index=external_call(global.u3d_create_wall,x2,y2,height,texture,texx1,texy1,texx2,texy2,partsx,partsy);
if(u3d_index){
    u3d_type=7;
}
return u3d_index!=0;


There was another small bug, I had to rename the floor object to floor2, because of the floor function and current naming conflicts.

Download: https://www.dropbox.com/s/6dbrhs17lr6m290/U3DSDKENIGMA.zip?dl=0
Size: 1.96 mb's

Website: http://ultimate3d.org/

Special shout out to the creator for helping with this port too!
Offline (Unknown gender) fervi

Member
Joined: Feb 2013
Posts: 78
View profile
Reply #1 Posted on: May 18, 2013, 03:55:49 PM
Linux or it didn't happen

Fervi
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #2 Posted on: May 18, 2013, 03:59:30 PM
I can't do anything about that I am not the one who wrote it to use DirectX.  :(
Offline (Unknown gender) Ideka

Member
Joined: Apr 2011
Posts: 85
View profile
Reply #3 Posted on: May 18, 2013, 05:07:24 PM
Why would you even bother then?
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #4 Posted on: May 18, 2013, 07:21:37 PM
Some people requested that I attempt to get it to work it only took me a little bit, and nonetheless at least it provides more capability to ENIGMA. Just putting this here in case anybody is interested in continuing it. However I should mention that the scripts that make dll call backs should be made into an ENIGMA extension and all those scripts hidden from the end user when using the extension.
Offline (Unknown gender) Aragon

Member
Joined: May 2014
Posts: 2
View profile
Reply #5 Posted on: June 05, 2014, 09:01:06 AM
Somebody had given another shot on this with any luck? I would love to port my game!
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #6 Posted on: June 05, 2014, 10:11:45 AM
No I have not Aragon, it would probably be a good idea for someone to take another shot at it as we are another year into development and have some major improvements such as inheritance, polymorphism, threading, and various bug fixes in major areas.
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #7 Posted on: December 07, 2014, 10:30:05 PM
Just an update, this extension has now been almost completely ported and should work about the same as it would with GM: Studio, it requires use of my special modified scripts which can be downloaded above. I had to fix some of our window flags to add the missing flags from GM8.1 that allow child windows to clip and render on top of our main window.
https://github.com/enigma-dev/enigma-dev/pull/884

Download the new Portable ZIP here if you don't want to update manually:
http://enigma-dev.org/docs/Wiki/Install:Windows

Enter the following in a terminal or with git-bash.exe if you have the Portable ZIP and want to update manually (you may also need to download the new LGM and plugin jars):
Code (Bash) Select

cd enigma-dev
git fetch
git pull
Pages: 1