Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: C++ vs. Lice-C performance [Re: sivan] #454268
09/02/15 20:18
09/02/15 20:18
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Just completely switch to C++ then, this porting is stupid and opens big doors for hackers because of the DLL imports/exports.
Also, you can easily translate wait(1) calls.
All you need to do is hooking into the main thread which is kinda easy.
Then you can just call GetModuleHandle/GetProcAddress on "acknex.dll" and "wait" to get the function address and call it.

Last edited by Ch40zzC0d3r; 09/02/15 20:32.
Re: C++ vs. Lice-C performance [Re: Ch40zzC0d3r] #454277
09/03/15 09:09
09/03/15 09:09
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
I think I will do it rather with UE4, and do not fight with 3DGS too much. I keep doing some prototyping tasks with 3DGS/Lite-c, but on my to-do-list only 4 corresponding items remained...
I could stay, and convert my stuff to a Lite-C/C++ mix, but as I am developing something long term, UE4 is a safer choice (and in practice faster to work with on smaller projects too).


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: C++ vs. Lice-C performance [Re: sivan] #454300
09/03/15 16:04
09/03/15 16:04

M
Malice
Unregistered
Malice
Unregistered
M



<--- Falls to knees, " Damn you UE4!!!!!!!"

Camera pulls back - Malice crouches in the rumble of 3dgs. In the distance an every growing crowd of users fill the paths leading to the safety of other engines. Around him the wreckage of this once great center of game development, decaying, neglected and abandoned.

Que dramatic music score.
Fade to black.

Re: C++ vs. Lice-C performance [Re: ] #454308
09/03/15 20:11
09/03/15 20:11
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: C++ vs. Lice-C performance [Re: Ch40zzC0d3r] #454330
09/04/15 13:12
09/04/15 13:12
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Originally Posted By: Ch40zzC0d3r
Then you can just call GetModuleHandle/GetProcAddress on "acknex.dll" and "wait" to get the function address and call it.

I am pretty sure that wait would not work as it works in lite-c.

Easiest way to do it as hellx said, use only one wait in your lite-c main, write your thing in c++ as an engine plugin, create a function (something like doFrame() ) and call it from lite-c in your main while-wait loop. Now you have a function that's called every frame, and you do not need any other scheduling/wait stuff. Then create an interface with an onFrame function and implement that interface in your entity classes then put them each of them into an array and call all of your entity instance's onFrame on that doFrame function. Code you normally write inside while - wait loops in your actions goes inside that onFrame now. You can also add further functions to handle creation/destruction functions to the interface. creation function is for code you put before your while-wait loops in your lite-c code and destruction function is for code you write after the loop.

you do not need to expose anything other than doFrame to lite-c. (maybe an init and a destroy function too.)


3333333333
Re: C++ vs. Lice-C performance [Re: Quad] #454332
09/04/15 16:55
09/04/15 16:55
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Originally Posted By: Quad
Originally Posted By: Ch40zzC0d3r
Then you can just call GetModuleHandle/GetProcAddress on "acknex.dll" and "wait" to get the function address and call it.

I am pretty sure that wait would not work as it works in lite-c.

Easiest way to do it as hellx said, use only one wait in your lite-c main, write your thing in c++ as an engine plugin, create a function (something like doFrame() ) and call it from lite-c in your main while-wait loop. Now you have a function that's called every frame, and you do not need any other scheduling/wait stuff. Then create an interface with an onFrame function and implement that interface in your entity classes then put them each of them into an array and call all of your entity instance's onFrame on that doFrame function. Code you normally write inside while - wait loops in your actions goes inside that onFrame now. You can also add further functions to handle creation/destruction functions to the interface. creation function is for code you put before your while-wait loops in your lite-c code and destruction function is for code you write after the loop.

you do not need to expose anything other than doFrame to lite-c. (maybe an init and a destroy function too.)




Well I did that already so Im sure it works.
Otherwise I wouldnt write it here..
Anyways you need some small adjustments and tricks to insert the function to the queue manually (only supports cdecl calling convention)
But I guess gonna be annoying for non reverse engineers so your way is much simplier grin

Last edited by Ch40zzC0d3r; 09/04/15 17:12.
Re: C++ vs. Lice-C performance [Re: Ch40zzC0d3r] #454340
09/04/15 20:28
09/04/15 20:28
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Isn't there this while(engine_frame()) construct for overcoming the need of wait()?

Re: C++ vs. Lice-C performance [Re: FBL] #454341
09/04/15 20:30
09/04/15 20:30
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Originally Posted By: Firoball
Isn't there this while(engine_frame()) construct for overcoming the need of wait()?


That should skip one frame yeah.
But you need a static bool to toggle it or otherwise you generate an infinite loop (Only if your func gets called in engine_frame of course tongue )

Last edited by Ch40zzC0d3r; 09/04/15 20:34.
Re: C++ vs. Lice-C performance [Re: Ch40zzC0d3r] #454342
09/04/15 20:45
09/04/15 20:45
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
...and it's not meant for plugins but for using the engine dll in C++. I misread somewhere something it seems... grin

Actually you don't need a toggle bool (the engine takes care of returning 0 on close events) - but you have to setup all your code below this while, which is your main loop.
So you can as well go for a while(bla) {dll_call(); wait(1);} grin

Re: C++ vs. Lice-C performance [Re: Ch40zzC0d3r] #456117
11/11/15 07:11
11/11/15 07:11
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Ch40zzC0d3r
I had a simple .net program which should read the bytes of a file and write them to a text file. It ran for around 5 hours where my C++ programm took 3 seconds...

No one commented on that yet?! WTF did you do?!?!?! 5 hours for something that should be IO bound and fast no matter what language you use?! This is the most ridiculous and ludicrous thing I have ever read, even in the completely interpreted world of Python you won't see such a performance discrepancy. And that is Python, we are talking about the CLR which is actually compiled to native machine code!

Like... Either you are bullshitting, or you were trying to be heavily biased in favour of C++ and made the C# version slow on purpose. My money is on the former.

Sorry, I didn't make it further than this post in the thread (minus some quick skimming of the thread to make sure no one commented on this gem yet). I'll have to leave again, my brain left out of my ear and I'm afraid I'll have to go and catch it again before I become a stumbling, mumbling idiot.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Page 2 of 3 1 2 3

Moderated by  TWO 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1