Minimizing memory usage from script

its just 2d layer but pretty heavy but GTA IV runs perfectly fine on the same cpu/gpu.. go figure.
2D games can be way more resource intensive than 3D games. Remember PS1? It was able to handle 3d graphics way easier than 2d graphics, thanks to how much RAM this type of asset can use - Just remember the stripped-down versions of MVC and other VS games in PS1, while it could run an almost-perfect Tekken 3.
 
Note this answer is largely simplified for anyone not all that familiar with graphical hardware and demands.

2D games can be way more resource intensive than 3D games. Remember PS1? It was able to handle 3d graphics way easier than 2d graphics, thanks to how much RAM this type of asset can use - Just remember the stripped-down versions of MVC and other VS games in PS1, while it could run an almost-perfect Tekken 3.

This is sort of true, but again it comes down to architecture. To understand why, you have to know what they are. What we call "2D" are just visual assets that were processed during development and then played back to the screen at runtime. We can apply special effects, squash, stretch, or whatever else, but the asset is the asset. When we say "3D", you're talking about assets that are generated live from a set of vectors and smaller bits of pixel-data. They both have advantages and drawbacks:

2D (pre-rendered assets):
  • + Full control of the asset's appearance. In most cases if the target hardware can reproduce it at all, then it can reproduce it perfectly.
  • + Less calculation intensive.
  • + Simple development process. Draw it - the end.
  • + Ages gracefully.
  • - Memory intensive.
  • - One viewing angle only.
  • - Expensive. "Draw it" requires a lot person hours, and it's very difficult to update.
3D (real time rendering)
  • + Design freedom. Once finished, you can manipulate your model however you feel like and view from any angle.
  • + Versatility. If you can build it in 2D, you can build it in 3D, but not the other way around.
  • + Less memory intensive.
  • + Easy to update and maintain. You can reuse 20 year old animations on a new model. Want to add new moves or options to your game? No problem.
  • - Calculation intensive.
  • - Variable user experience.
  • - Ages poorly.
Over time, some of these things have started to become a mute point. 2D is memory intensive, so if you didn't have a pile of RAM or instant ROM access you were boned (see PlayStation One). Now RAM is so plentiful and cheap it doesn't matter any more; any machine from the last 10 years can easily brute force dozens of times the pixel data 4th gen hardware could manage. At the same time, 3D is approaching quality levels where you can't distinguish it from pre-rendered assets.

It really comes down to production needs and game design. Most publishes make use of both. Particle effects and background decorations tend to be pre-rendered, while other objects are polygon models.

From a performance standpoint, it's much more complex than before. In the 4th gen console days, your graphics chip could do exactly X amount of things and no more. The upside was they never bogged down. No matter what you do, that little chipset just keeps chugging along at rock solid 60FPS. As long as the game mechanics crunch fast enough to keep it fed you're golden. Those days are gone. Now the CPU and GPU are intertwined in a spider web with so many different forms of hardware acceleration (and potential bottlenecks) it's impossible to list them all.

DC
 
Sure guys but i was talking about PC and android, the same pc that runs gta4, its quite hard to believe that "simple" alpha effect cloned 3 times can drop fps to 20... The code that does it in the engine is my main suspect but like i wrote, its beyond my skill level to try to take it away and bring it back step by step to pinpoint where it drops the ball.
 
directive ensures that the script is only compiled and stored in memory once, instead of 113 times. And that's all! No further changes are needed. Just this one change brings the memory usage of Double Dragon Reloaded down from 118.6 MB to 52.5 MB, according to the Windows system monitor.
I had this question but no one really gave me a straight answer. DC has tried to help me before, but some of his high level coding language and shortcuts he wrote I don't understand.... :-(

First of all, sorry for asking newbie questions.
I just want to code my game the right way.
I know I can just put down the code and make it run and be done with it, but this is not how I am.
I want to do it the right way., please help, thank you.

Once all the functions/scripts in this animationscript are stored in the memory, does it consume more memory everytime you call out (use) the functions/scripts from the animationscript?

The reason I am asking this is because I am not sure whether I should use function/script for the FX model that only needs to use 1 function/script from this animationscript.
Please see the examples for details.

instead of

Method 1:
Code:
name    Flash
type    none
shadow    0
nomove 1 1
setlayer 1003
antigravity 100
alpha    1

animationscript    data/scripts/anim/MainAnim_All.c

anim idle
    loop    0
    offset  968 545
    delay    4
    @cmd    SoundFX "Flash.wav" 100
    frame    data/chars/misc/flash/Flash1_01.png

MainAnim_All.c
Code:
#import "data/scripts/anim/MainAnim.c"
#import "data/scripts/anim/Mobility_Anim.c"
#import "data/scripts/anim/MpSmSpEx.c"
#import "data/scripts/anim/Spawns_Anim.c"
#import "data/scripts/anim/Grabs_Anim.c"
#include "data/scripts/common/constants.h"

I used this

Method 2:
Code:
name    Flash
type    none
shadow    0
nomove 1 1
setlayer 1003
antigravity 100
alpha    1


anim idle
    loop    0
    @script
        if(frame == 0){    //Left/Right stereo workaround
        void self = getlocalvar("self");
        int PlayerDir = getentityproperty(self, "direction");
   
        int EdgeXPos = openborvariant("xpos"); //Get screen left edge's position
        int ScreenRes = openborvariant("hResolution"); // Get screen width/horizontal
   
        float XPos = getentityproperty(self, "x");
        int X = XPos - EdgeXPos;
        float Left = (ScreenRes - X) / ScreenRes * 100;
        float Right = X/ScreenRes * 100;
   
        playsample(loadsample("data/sounds/"+"Flash.wav"),  1, Left, Right, 100, 0);
        //playsample(sample, prioroity, Left volume, Right volume, speed, loop)
        }
    @end_script
    offset  968 545
    delay    4
    frame    data/chars/misc/flash/Flash1_01.png


As you can see, I have other animationscripts imported in MainAnim_All.c

Since I only need to use 1 function
Code:
@cmd    SoundFX "Flash.wav" 100
from the main animationscript, so I am not sure if I should use - method 1 or method 2 ? and why?

Furthermore, Will the unused scripts consume memory????
Can someone please help me understand how the system manages the memory for functions/scripts?

Thank you so much for your help and time
 
Last edited:
I had this question but no one really gave me a straight answer. DC has tried to help me before, but some of his high level coding language and shortcuts he wrote I don't understand.... :-(
Allow me to correct you, because this information is neither correct nor fair to everyone who has tried to help you - including me. And if you'll allow me to be honest with you, I find this type of allegation more than unfair - it borders on being offensive.

This behavior bothers me a lot because I've seen it happen before - the user can't/doesn't want to understand an explanation that is given to him, repeats the same question several times in the forum, people answer more times, until the moment they get tired of answering the same thing...

And it is at this moment that the user starts to badmouth the community, the members, the moderators and the administration with absurd allegations/demands such as "no one helps him", "the forum is full of politics" and other things that I prefer not to exemplify.

Your own statement already refutes what you allege.

And speaking personally, I always try to help everyone in the community, when I see that the person is genuinely wanting to learn. But when I realize that the person doesn't make an effort and wants everything "pre-cooked" - and I could give several names here - I start to ignore that user. In fact, this was one of the reasons that made me leave the administration, because I could not, as a rule, ignore a member as an administrator.

I really don't want to offend you. It's just that this is the last time I intend to answer a question of yours, due to what was explained above. I've "seen this movie before", as they say here in my country.

I'll try to explain what I can, but first I need to give you two pieces of advice - which I've given you before:

1- Start small. You're trying to bite off more than you can chew. Try reading the manual and familiarizing yourself with the engine first, and then gradually venture into scripting. I remember I've even made this analogy before: using scripts is like handling a chainsaw; knowing how to use it correctly is an incredible tool, but handling the chainsaw incorrectly is quite capable of causing fatal damage.

2- We've already suggested that you take a basic template and start working on it, instead of basing yourself on an extremely questionable project, morally speaking, that was made for a "customized" version of the engine, because there are things that won't work in any version, especially in the V4 version of the engine.

TL;DR

Once all the functions/scripts in this animationscript are stored in the memory, does it consume more memory everytime you call out (use) the functions/scripts from the animationscript?
As far as I understand, no. That's why we use scripts in a function file and use this method to optimize memory usage - and here we're not just talking about memory, but about computational resources in general.

And, it's worth remembering that certain types of scripts have different functionalities, such as animationscript, updatescript, onmovexscript, etc.

from the main animationscript, so I am not sure if I should use - method 1 or method 2 ? and why?
Because the second method uses inline script, which is generally not recommended (except in specific cases). And contrary to what you claimed, it was already explained to you before by @DCurrent, who even gave you the link with the more complex explanation: Optimizing Scripts

The example you gave, using inline script, will use more memory than if it were in a function.
Furthermore, Will the unused scripts consume memory????
If it's in a single large file that you import but don't use, yes. That's why it's recommended to break the file into different files, for specific functions (like sounds, position, effects, etc.) and only import the ones you need for each entity. It's not always a good idea to have a single large file with, for example, 200 functions and import it for the entire entity... if they're going to use 3 functions from there.

Can someone please help me understand how the system manages the memory for functions/scripts?
That's basically what the topic is about :)

Sorry if I sound harsh, it's just that this kind of thing really bothers me and ends up affecting the entire community.
 
Sorry if I sound harsh, it's just that this kind of thing really bothers me and ends up affecting the entire community.
First of all, I really appreciate for your help and everyone else.
No you are not harsh at all. Sorry, it was actually my fault and it is my apology for it.
It is not your guys fault for using high level coding language....it is just that I don't understand some of them :-(
and sorry for asking multiple questions of the same thing in different topics. I will try to remember not to do that again.

I've been trying to read and understand the manual which is good and I really appreciate to the people who have put a lot of efforts into it.
Everytime I got stuck, I try to read the manual first for solution before going to the forum for help.
However, because of my inexperience with the coding language and limited details and examples on the manual, alot of stuff on it are not easy for me to understand.
Also, I am more like a hands on person. I can not remember of what I read....
I got to work on it to learn...

I am really sorry guys


---------------------------------------------------------------------------

I really appreciate for your details explanations which help me alot
If it's in a single large file that you import but don't use, yes. That's why it's recommended to break the file into different files, for specific functions (like sounds, position, effects, etc.) and only import the ones you need for each entity. It's not always a good idea to have a single large file with, for example, 200 functions and import it for the entire entity... if they're going to use 3 functions from there.
Can you please explain this furthermore?

For example,
in my MainAnim_All.c
Code:
#import "data/scripts/anim/MainAnim.c"
#import "data/scripts/anim/Mobility_Anim.c"
#import "data/scripts/anim/MpSmSpEx.c"
#import "data/scripts/anim/Spawns_Anim.c"
#import "data/scripts/anim/Grabs_Anim.c"
#include "data/scripts/common/constants.h"

so if I create a SoundFX animationscript which will 1 function on it
and then import this SoundFX.c into this MainAnim_All.c

then in the Flash model, I add this line
animationscript data/scripts/anim/MainAnim_All.c

wouldn't the other animationscripts that are imported in MainAnim_All.c below also affect the computational resources/memory?
Code:
#import "data/scripts/anim/MainAnim.c"
#import "data/scripts/anim/Mobility_Anim.c"
#import "data/scripts/anim/MpSmSpEx.c"
#import "data/scripts/anim/Spawns_Anim.c"
#import "data/scripts/anim/Grabs_Anim.c"

Or only the SoundFX animationscript on the list will be used although there are other animationscripts on the list?

Thank you
 
First of all, I really appreciate for your help and everyone else.
No you are not harsh at all. Sorry, it was actually my fault and it is my apology for it.
It is not your guys fault for using high level coding language....it is just that I don't understand some of them :-(
and sorry for asking multiple questions of the same thing in different topics. I will try to remember not to do that again.

I've been trying to read and understand the manual which is good and I really appreciate to the people who have put a lot of efforts into it.
Everytime I got stuck, I try to read the manual first for solution before going to the forum for help.
However, because of my inexperience with the coding language and limited details and examples on the manual, alot of stuff on it are not easy for me to understand.
Also, I am more like a hands on person. I can not remember of what I read....
I got to work on it to learn...

I am really sorry guys


---------------------------------------------------------------------------

I really appreciate for your details explanations which help me alot

Can you please explain this furthermore?

For example,
in my MainAnim_All.c
Code:
#import "data/scripts/anim/MainAnim.c"
#import "data/scripts/anim/Mobility_Anim.c"
#import "data/scripts/anim/MpSmSpEx.c"
#import "data/scripts/anim/Spawns_Anim.c"
#import "data/scripts/anim/Grabs_Anim.c"
#include "data/scripts/common/constants.h"

so if I create a SoundFX animationscript which will 1 function on it
and then import this SoundFX.c into this MainAnim_All.c

then in the Flash model, I add this line
animationscript data/scripts/anim/MainAnim_All.c

wouldn't the other animationscripts that are imported in MainAnim_All.c below also affect the computational resources/memory?
Code:
#import "data/scripts/anim/MainAnim.c"
#import "data/scripts/anim/Mobility_Anim.c"
#import "data/scripts/anim/MpSmSpEx.c"
#import "data/scripts/anim/Spawns_Anim.c"
#import "data/scripts/anim/Grabs_Anim.c"

Or only the SoundFX animationscript on the list will be used although there are other animationscripts on the list?

Thank you
@ O Ilusionista, sorry if I did piss you off in some ways, please forgive me bro. I have no intention of doing it. I am here to learn and help others when I get better.
Regardless, you are still one of the biggest supports in my learning. Really appreciate for all your helps in the past.
I've spent more time on working my game for the past weeks since I have more time.
My Demo will be ready sometimes this year and it will be good. It's becoming a reality it is because of you and everyone else on this forum which I would never forget!

Although I've followed O Ilusionista's steps to optimize the memory/performance which helps alot, but there is still a question in my mind.
Can someone else please help me understand for the question that I had above?

Thank you
 
Guys,

Sorry this optimization always confuses me...
I've encountered this matter and it has been in my head...
I understand that by using #include ""
void main()
{
actual_main();
}
and breaking big file into small files as needed to optimize the memory/performance.

Now I've come to the situation where I have:
DidHit_All.c
Code:
#include "data/scripts/didhit/DidHit_Main.c"
#include "data/scripts/didhit/PickUpOrb.c"
#include "data/scripts/didhit/PickUpSummon.c"

At first, I was only using the DidHit_Main.c for the player models.
Now I just modified it to use it for both player and enemy models.

Is it better to use
1. DidHit_All.c for both player and enemy models as is

2. or optimize the DidHit_Main.c with DidHit_Main_actual and use it for enemy models as

Code:
#include "data/scripts/didhit/DidHit_Main_actual
.c"

void main()
{
    actual_main();
}

3. or break DidHit_Main.c into 2 files?
DidHit_All.c
Code:
#include "data/scripts/didhit/DidHit_Main.c"
#include "data/scripts/didhit/DidHit_Main2.c"
#include "data/scripts/didhit/PickUpOrb.c"
#include "data/scripts/didhit/PickUpSummon.c"

BTW, this DidHit_Main.c only has a few if statements.

Can someone please help me understand it?

Thank you very much for your time and help.
 
@Bruce The way I do this is simple, but when it comes to some little specifics they can be (a little) tricky. I have a TON/LOT of animation scripts working for #importing/#including, but the only animation script I cannot run like that is drago.c itself. That's because if I try including it while I have it imported, the log will put a message saying there's a memory leak and that could be too much script to read, I think. Now, I use drago.c for one of the characters only. I will use it for another character later. Also, I will figure out to make drago_actual.c working again later. I made several attempts to make it work but failed.

Here, I import one animation script to a real one.

script.c:
C:
#import    "data/scripts/actual/script_actual.c"

And in a real animation script I am using, I include these and some of them have plenty scripts/functions too. Some have small functions. All scripts that I included DO work except drago.c.

script_actual.c:
C:
#include "data/scripts/paus0001.c" //Pause effect (Courtesy of Damon Caskey)
#include "data/scripts/dcancel.c" // Yes, it's #included in this animation script, but it's also #imported from keyall.c
#include "data/scripts/jumpmode.c" //Jump mode (Courtesy of Piccolo for the jumping template, and maxman for creating new jump types from the template) / WARNING: THIS IS VERY IMPORTANT!!!
#include "data/scripts/ani0020.h" //Animation (Courtesy of Damon Caskey)
#include "data/scripts/shadow.c" // Shadow script (Courtesy of msmalik681)
#include "data/scripts/library/basic.h" // Script library (Courtesy of Bloodbane)
#include "data/scripts/library/spawn.h" // I also included parts of the library scripts from Bloodbane and they do work ;)
#include "data/scripts/library/target.h"
#include "data/scripts/aniScp.c" // Tons of scripts from MatMan and they do definitely work, but one single file of it is imported too.
//#include "data/scripts/drago.c" // This is the only animation script I can't run due to some unusual specifics, I think.

If you're wondering dcancel.c being included in animation script and imported from keyall.c, this is because I wanted to include keys to press (as part of animation script(?)).

C:
#import "data/scripts/dcancel.c"
#import "data/chars/misc/continueanim/contkey.c"
//#import "data/scripts/BasicKeycapture.c"

void main(){
   
    daimaoKeyCancel();
    continueKey();
}

dcancel.c is an animation script because there's no name for void main() in it. It has a couple of the lines #imported.
C:
#import "data/scripts/common/mathutil.c"
#import "data/scripts/anim/direction.c"

Eh! They're animation scripts too I noticed!

ani0020.h is included in the real one:
C:
#import    "data/scripts/actual/ani0020_actual.h"

in ani0020_actual.h file, you have this here.
C:
#include "data/scripts/ani0009.h"

For ani0009.h, same thing I did with ani0020.h, but I don't really have to put it inside script_actual.c file.

If you're also wondering about the use of aniScp.c (animation script from OpenBORStats) working with lots of scripts in it, I started to #import this because it has plenty functions.

aniScp.c:
Code:
#import "data/scripts/actual/aniScp_actual.c"

Because I cannot use drago.c in script_actual.c file, I use these to include for one character that can use functions in drago.c.

drago.c:
Code:
#include "data/scripts/script.c"
#include "data/scripts/aniScp.c"

Note that the two scripts that I included are all imported as I gave as an example.

For your case, I don't know. It seems like you are confused about the use of directives on specific scripts. Here, I use @Mr.Q!'s Fight Forever demo as an example for minimizing memory with script. Not sure if I did it with this, but I'm quite sure I did it with my ROD project and yes, it compressed/shrunk its size smaller. I also can conclude that I did the same thing with his FF project.

For example, I had this lib001.c file in the scripts folder and placed specific scripts here in the following without creating a folder for it.

C:
#import "data/scripts/shadow.c"
#import "data/scripts/main_audio.c"
#import "data/scripts/frameland.c"

The easiest thing is renaming it as "file_name_actual.c" and placing it in the named actual subfolder of the scripts folder. However, the next part is tricky because leaving them as is causes a crash in the renamed file. What I did was that I needed to find which one I can include for it to not crash. I chose to #import main_audio.c in lib001.c in the main scripts folder like this here.

lib001.c:
C:
#import "data/scripts/actual/lib001_actual.c"
#import "data/scripts/main_audio.c"

(You can use #import or #include on main_audio.c in lib001.c because I just tested it and both of them work for me. But I prefer using #import since it was originally created for the sounds of hitting objects.)

lib001_actual.c:
Therefore, I leave the other two scripts in lib001_actual.c here.
C:
#import "data/scripts/shadow.c"
#import "data/scripts/frameland.c"

After solving that problem, I figured out where main_audio.c file comes from. It was #imported from main_didhit.c because main_didhit.c is used as didhitscript for a playable character to hit objects for hearing sounds.

This character has main_didhit for hitting obstacles.
Code:
didhitscript            data/scripts/main_didhit.c

main_audio.c is #imported in main_didhit.c.

main_didhit.c:
C:
#import "data/scripts/main_audio.c"

Find one that doesn't cause a crash for your animation script(s), and the other that does. Check which files and/or functions you linked to (or from) and inspect where they (directly) come from and where they are directed to. It might sound confusing to you, but you can give it a try. Look out for some specifics and be careful with directing stuff with #include and #import.
 
Last edited:
@Bruce The way I do this is simple, but when it comes to some little specifics they can be (a little) tricky. I have a TON/LOT of animation scripts working for #importing/#including, but the only animation script I cannot run like that is drago.c itself. That's because if I try including it while I have it imported, the log will put a message saying there's a memory leak and that could be too much script to read, I think. Now, I use drago.c for one of the characters only. I will use it for another character later. Also, I will figure out to make drago_actual.c working again later. I made several attempts to make it work but failed.

Here, I import one animation script to a real one.

script.c:
C:
#import    "data/scripts/actual/script_actual.c"

And in a real animation script I am using, I include these and some of them have plenty scripts/functions too. Some have small functions. All scripts that I included DO work except drago.c.

script_actual.c:
C:
#include "data/scripts/paus0001.c" //Pause effect (Courtesy of Damon Caskey)
#include "data/scripts/dcancel.c" // Yes, it's #included in this animation script, but it's also #imported from keyall.c
#include "data/scripts/jumpmode.c" //Jump mode (Courtesy of Piccolo for the jumping template, and maxman for creating new jump types from the template) / WARNING: THIS IS VERY IMPORTANT!!!
#include "data/scripts/ani0020.h" //Animation (Courtesy of Damon Caskey)
#include "data/scripts/shadow.c" // Shadow script (Courtesy of msmalik681)
#include "data/scripts/library/basic.h" // Script library (Courtesy of Bloodbane)
#include "data/scripts/library/spawn.h" // I also included parts of the library scripts from Bloodbane and they do work ;)
#include "data/scripts/library/target.h"
#include "data/scripts/aniScp.c" // Tons of scripts from MatMan and they do definitely work, but one single file of it is imported too.
//#include "data/scripts/drago.c" // This is the only animation script I can't run due to some unusual specifics, I think.

If you're wondering dcancel.c being included in animation script and imported from keyall.c, this is because I wanted to include keys to press (as part of animation script(?)).

C:
#import "data/scripts/dcancel.c"
#import "data/chars/misc/continueanim/contkey.c"
//#import "data/scripts/BasicKeycapture.c"

void main(){
 
    daimaoKeyCancel();
    continueKey();
}

dcancel.c is an animation script because there's no name for void main() in it. It has a couple of the lines #imported.
C:
#import "data/scripts/common/mathutil.c"
#import "data/scripts/anim/direction.c"

Eh! They're animation scripts too I noticed!

ani0020.h is included in the real one:
C:
#import    "data/scripts/actual/ani0020_actual.h"

in ani0020_actual.h file, you have this here.
C:
#include "data/scripts/ani0009.h"

For ani0009.h, same thing I did with ani0020.h, but I don't really have to put it inside script_actual.c file.

If you're also wondering about the use of aniScp.c (animation script from OpenBORStats) working with lots of scripts in it, I started to #import this because it has plenty functions.

aniScp.c:
Code:
#import "data/scripts/actual/aniScp_actual.c"

Because I cannot use drago.c in script_actual.c file, I use these to include for one character that can use functions in drago.c.

drago.c:
Code:
#include "data/scripts/script.c"
#include "data/scripts/aniScp.c"

Note that the two scripts that I included are all imported as I gave as an example.

For your case, I don't know. It seems like you are confused about the use of directives on specific scripts. Here, I use @Mr.Q!'s Fight Forever demo as an example for minimizing memory with script. Not sure if I did it with this, but I'm quite sure I did it with my ROD project and yes, it compressed/shrunk its size smaller. I also can conclude that I did the same thing with his FF project.

For example, I had this lib001.c file in the scripts folder and placed specific scripts here in the following without creating a folder for it.

C:
#import "data/scripts/shadow.c"
#import "data/scripts/main_audio.c"
#import "data/scripts/frameland.c"

The easiest thing is renaming it as "file_name_actual.c" and placing it in the named actual subfolder of the scripts folder. However, the next part is tricky because leaving them as is causes a crash in the renamed file. What I did was that I needed to find which one I can include for it to not crash. I chose to #import main_audio.c in lib001.c in the main scripts folder like this here.

lib001.c:
C:
#import "data/scripts/actual/lib001_actual.c"
#import "data/scripts/main_audio.c"

(You can use #import or #include on main_audio.c in lib001.c because I just tested it and both of them work for me. But I prefer using #import since it was originally created for the sounds of hitting objects.)

lib001_actual.c:
Therefore, I leave the other two scripts in lib001_actual.c here.
C:
#import "data/scripts/shadow.c"
#import "data/scripts/frameland.c"

After solving that problem, I figured out where main_audio.c file comes from. It was #imported from main_didhit.c because main_didhit.c is used as didhitscript for a playable character to hit objects for hearing sounds.

This character has main_didhit for hitting obstacles.
Code:
didhitscript            data/scripts/main_didhit.c

main_audio.c is #imported in main_didhit.c.

main_didhit.c:
C:
#import "data/scripts/main_audio.c"

Find one that doesn't cause a crash for your animation script(s), and the other that does. Check which files and/or functions you linked to (or from) and inspect where they (directly) come from and where they are directed to. It might sound confusing to you, but you can give it a try. Look out for some specifics and be careful with directing stuff with #include and #import.
Thank you for the detail explanation.

By now, I don't understand the differences between the
#import and #include

I know for the #include,
I have to have something like this
void main()
{
actual_main();
}
while the #import doesn't seem to have it

Other than that, I don't know the benefits of using #include compared to #import or the other way around.
Can you help me understand this?

My game is in 1080p, this is why everything I code must not have memory leak. Otherwise, it will be OOM quickly.
I know it is tough to create 1080p from Openbor engine, but that doesn't mean it's impossible and I always love high resolution graphics games...
I just have to smart trying to find the best way to code as much as I can to avoid OOM.
I will have to unload some models when they are not in used in the level and cut down the sprite quantities to avoid OOM.

I know some of the folks here dis-encouraged me to not continue with 1080p project which I understand their reasons why and I do very appreciate for their supports,
but I won't give up with this project. I know it is tough for me, but I will find a way to make it work!
Regardless, I am still very grateful and thanks to the all the folks who have been supporting me,
especially thanks to all the talented folks who came up with this OpenBor engine.
I've already committed to myself that once my game is finished, and if I receive any of the donations for supporting my game, 50% of it will go to this website.

Thank you for your help maxman
 
Last edited:
By now, I don't understand the differences between the
#import and #include
 
Back
Top Bottom