Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,501 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
AKProfiler #457875
02/04/16 21:54
02/04/16 21:54
Joined: Sep 2007
Posts: 101
Luxembourg
K
krial057 Offline OP
Member
krial057  Offline OP
Member
K

Joined: Sep 2007
Posts: 101
Luxembourg
Github link for nicer formated README + Download:
https://github.com/krial057/3dgs-Projects/tree/master/AKProfiler

Copy Pasta from Github README:

AKProfiler

Description
AKProfiler is a tool to profile Lite-c code. Lite-C is mainly used for games developed in the "3d game stuio" game engine. It will log all function calls / waits and return from waits into a file.

Important
This script was written in a short amount of time. MAKE A BACKUP OF YOUR PROJECT before using it, because it was pretty much not tested at all. Normally it shouldn't change any of your files, but you never know...

How to use

Copy the AKProfiler.c file into your project folder and include it anywhere in your project: #include "AKProfiler.c"

Start your project as usual(The engine window will start twice, this is normal!)
The function calls will the be logged in AKP.log on game exit.

If you want the functions of a specific file not to be profiled, yon add the following comment on the first line of the source code: //AKP_DO_NOT_PROFILE

TODO
* Start and stop parsing with buttons/keys
  * Very easy to implement, however need to decide how the user should interact with the plugin + see next point
* Make a graphical user-interface to show statistics of function calls
  * Ideas: generate html file, Google sheet template, draw stats inside the game window
* Show stack trace of functions on engine crash

Restrictions
* Maximal file size to parse is by default a bit less than 100000 characters. You can change that by modifying the following line in "AKProfiler.c": #define AKP_MAX_SCRIPT_SIZE 100000
* on_exit will be overriden

How it works
* AKProfiler.c has a startup function that execute immediatly when the engine starts.
* It immedialty pauses the game.
* It then looks for the main file of your project(First command line parameter).
* Next it parses that file and all files that are included into that file.
* It creates new temporary files for all these files with profiler functions injected at function starts/ends and wait's.
* Then it executes the main temporary file in a new acknex process.
* That process is now your game with profiling functions included in the scripts.
* When the process ends, it deletes all temporary files.

Last edited by krial057; 02/05/16 11:43.
Re: AKProfiler [Re: krial057] #457877
02/04/16 22:34
02/04/16 22:34
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Interesting, thanks for sharing!
Going to check that out soon - hoping that I don't forget.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  aztec, Blink, HeelX 

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