Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - nabz32

Pages: [1] 2
1
GLBasic - en / GLBasic pointer question
« on: 2017-Jul-23 »
Hello again,

only a small question, is it possible to build a linked list
in glbasic, something like:

Code: GLBasic [Select]
TYPE element

*element // store the next element in the list..

ENDTYPE
 

And then check if this Pointer is NULL?

Or is ist possible to access a c class inside the GLBasic code, without using EXTERN "C" all the time?
Having the abillity to write a linked list in GLBasic would be awesome.


2
Hi, I  recently compiled my game on a new laptop and the game crashes after compile
and won´t close unless I kill it using the task manager.

Tried to run it in debug mode and it crashes if no break points are set,
however if I set some breakpoints during the initialisation process the game starts up correctly,
however I get a random c0000005 crash somewhere during gameplay all the time.

I used a lenovo think pad T430 with an intel HD 4000 graphic chip for testing.
Could this be hardware related?

3
GLBasic - en / interpolating tree branches
« on: 2016-Sep-20 »
Hello, I wanted to create a new world engine, where the whole world is build out of paths.

I give each path point a certain thickness, so an actual area is created from branch to branch with a certain width
( the length of the area is the distance between two points of the path ),
like this:



In this shot each father point has only one son, so the points can easily be interpolated.

If a father has two sons, i need to put some sort of triangle between the tree, to make a nice transition between those.
How to calculate this triangle out of the 3 branches, so that none of these branches overlap each other?

Here is how it looks with 2 sons without interpolation or a triangular spacer between the 3:


( subdivision is also different between the 2 pics in case you wonder )




4
Hi I want to rewrite my drawing routine, so that all drawable 3D Objects are sorted by the distance to the camera first and then drawn in that order.
Mainly I wanted to improve the rendering on android, to avoid some of the z-buffer problematic.

In the old draw routine I drew objects without light influence before light was enabled,
but if I sort every drawable object by its camera distance, I have to find some other way to disable light for certain objects.

Can light be turned off and on again for not lighting affected objects?

5
Well, I tried to compile for android, but I get errors:

Code: GLBasic [Select]
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:ea2d5b8f - 3D, NET
Wordcount:21984 commands
compile+link:

running glb_build.bat
Using ANDROID_TARGET="android-22"
You can use "C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
%ANDROIDSDK% not set. Using GLBasic's default target-22, Android 5.1 (Lollipop
ECHO ist ausgeschaltet (OFF).
androidmanifest.xml:
Make sure to check do a manual check for those.
android:minSdkVersion="10" android:targetSdkVersion="22"
ECHO ist ausgeschaltet (OFF).

AndroidIcons.exe [v21-3-2015] running...
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_36_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-ldpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_48_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-mdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_72_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_72_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-hdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_96_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xhdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_180_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xxhdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_192_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xxxhdpi/icon.png
C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_ouya_AndroidExtras.png is missing (732x412 size)
the Ouya icon is not important, if you dont want to support the console
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_ouya_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xhdpi/ouya_icon.png

Checked AdActivity (intersititals):
Does not uses a AdActivity

Android Extras version (SDLActivity.java):
* 2.11.2

Checking Icons Finished...

BUILD STAGE 2: Start compiler (android.bat)
SDK=Q:\Compiler\platform\android\bin\..\android-sdk-windows
Updated project.properties
Updated local.properties
Updated file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\build.xml
Updated file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\proguard-project.txt
Updated and renamed default.properties to project.properties
Updated local.properties
Added file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\build.xml
Added file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\proguard-project.txt
.
BUILD STAGE 3: Build a debug build
Buildfile: C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 24.2.0
 [checkenv] Installed at Q:\Compiler\platform\android\android-sdk-windows

-setup:
     [echo] Project Name: glbasic
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 21.1.2
     [echo] Resolving Build Target for glbasic...
[gettarget] Project Target:   Android 5.1.1
[gettarget] API level:        22
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\rsObj
    [mkdir] Created dir: C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\rsLibs
     [echo] ----------
     [echo] Resolving Dependencies for glbasic...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 30 source files to C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\.reggieworld\R.java:8: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\reggieworld\BuildConfig.java:2: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] 2 errors
    [javac] 3 warnings

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:720: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.

Total time: 6 seconds
.
BUILD STAGE 4: Build a release build
   [subant] No sub-builds to iterate on
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\.reggieworld\R.java:8: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\reggieworld\BuildConfig.java:2: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] 2 errors
    [javac] 3 warnings

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:720: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.

Total time: 1 second
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
HOW TO INSTALL? Install by invoke this command:
"Q:\Compiler\platform\android\bin\..\android-sdk-windows\platform-tools\adb.exe" install -r "C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android/bin/glbasic-debug.apk"
.
HOW TO SIGN? Sign it by invoke this command:
"Q:\Compiler\platform\android\bin\glb_code_sign.bat" "C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android"
.
Android=C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 107.7 sek. Zeit: 20:07
Erstellen: 1 erfolgreich.

 

Could it be, that there a problems when usìng java 64bit SDK?


6
Habe mal versucht für Android zu kompileren, bekomme aber das:

Code: GLBasic [Select]
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:ea2d5b8f - 3D, NET
Wordcount:21984 commands
compile+link:

running glb_build.bat
Using ANDROID_TARGET="android-22"
You can use "C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
%ANDROIDSDK% not set. Using GLBasic's default target-22, Android 5.1 (Lollipop
ECHO ist ausgeschaltet (OFF).
androidmanifest.xml:
Make sure to check do a manual check for those.
android:minSdkVersion="10" android:targetSdkVersion="22"
ECHO ist ausgeschaltet (OFF).

AndroidIcons.exe [v21-3-2015] running...
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_36_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-ldpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_48_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-mdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_72_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_72_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-hdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_96_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xhdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_180_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xxhdpi/icon.png
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_192_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xxxhdpi/icon.png
C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_ouya_AndroidExtras.png is missing (732x412 size)
the Ouya icon is not important, if you dont want to support the console
copy C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/icon_ouya_AndroidExtras.png to C:/Users/Nabz/Desktop/GLBasicProjects/GLBasic/reggieWorldMRewrite/distribute/Android/res/drawable-xhdpi/ouya_icon.png

Checked AdActivity (intersititals):
Does not uses a AdActivity

Android Extras version (SDLActivity.java):
* 2.11.2

Checking Icons Finished...

BUILD STAGE 2: Start compiler (android.bat)
SDK=Q:\Compiler\platform\android\bin\..\android-sdk-windows
Updated project.properties
Updated local.properties
Updated file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\build.xml
Updated file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\proguard-project.txt
Updated and renamed default.properties to project.properties
Updated local.properties
Added file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\build.xml
Added file C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\proguard-project.txt
.
BUILD STAGE 3: Build a debug build
Buildfile: C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 24.2.0
 [checkenv] Installed at Q:\Compiler\platform\android\android-sdk-windows

-setup:
     [echo] Project Name: glbasic
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 21.1.2
     [echo] Resolving Build Target for glbasic...
[gettarget] Project Target:   Android 5.1.1
[gettarget] API level:        22
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\rsObj
    [mkdir] Created dir: C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\rsLibs
     [echo] ----------
     [echo] Resolving Dependencies for glbasic...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 30 source files to C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\bin\classes
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\.reggieworld\R.java:8: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\reggieworld\BuildConfig.java:2: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] 2 errors
    [javac] 3 warnings

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:720: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.

Total time: 6 seconds
.
BUILD STAGE 4: Build a release build
   [subant] No sub-builds to iterate on
    [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
    [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\.reggieworld\R.java:8: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android\gen\com\reggieworld\BuildConfig.java:2: error: illegal '.'
    [javac] package com..reggieworld;
    [javac]             ^
    [javac] 2 errors
    [javac] 3 warnings

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:720: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:734: Compile failed; see the compiler error output for details.

Total time: 1 second
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
HOW TO INSTALL? Install by invoke this command:
"Q:\Compiler\platform\android\bin\..\android-sdk-windows\platform-tools\adb.exe" install -r "C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android/bin/glbasic-debug.apk"
.
HOW TO SIGN? Sign it by invoke this command:
"Q:\Compiler\platform\android\bin\glb_code_sign.bat" "C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android"
.
Android=C:\Users\Nabz\Desktop\GLBasicProjects\GLBasic\reggieWorldMRewrite\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 107.7 sek. Zeit: 20:07
Erstellen: 1 erfolgreich.

 

Das sieht so aus als würde er sich über einen zusätzlichen Punkt aufregen, oder hab ich irgendeinen schwerwiegenden Fehler weiter oben in der Compiler Ausgabe übersehen?

Edit: habe Java 64 bit sdk installiert, kann das Probleme verursachen?



7
The game is finished so far.
It is a top down shooter where you have to kill zombies.
Made this for the Low Res Jam on itch.io

Here is the page on itch.io with a download link.
Currently only for windows
https://itch.io/jam/lowrezjam2016/rate/62453

Features:
5 Maps in a loop with increasing difficulty each time the game loops
2d light engine

<a href="http://www.youtube.com/watch?v=kSTPhAwlC1M" target="_blank">http://www.youtube.com/watch?v=kSTPhAwlC1M</a>

8
Hello, I am in the process of writing a polyvector print function for my game, to achieve some cool effects.

I just wanted to know how GLBasic internally calculates its kerning in its PRINT function?
Does it use some kind of std kerning table ( since fonts are only loaded as .bmp / .png and not the .fnt file itself or how it is called )?
Or does it calculate a kerning table using the font.bmp data on loadfont ( by parsing each letter field with some algorythm )?

 

9
GLBasic - de / Windows XP kompatibilität?
« on: 2016-Jan-23 »
Hallo,
beim Testen unter Windows XP bekommt ein Kollege aus dem deutschen gp2x forum
scheinbar zufällige Abstürze,

Anscheinend konnte read nicht auf dem vom Programm reservierten Speicher ausgeführt werden,
( so zumindest die Windows Fehlerausgabe ).
Hatte so etwas bisher noch nicht gehabt beim testen unter windows 7.

Update:
Der Kollege hat nun Win7 installiert, nun läuft es.
War wohl eher ein zerschossenes System Schuld, wie ich vermute.


10
Hallo,

wollte mich endlich mal dem Thema Gesichtsanimationen für meine NPCs in Reggie World widmen.

Ich habe mir dazu zwei Möglichkeiten überlegt:

1. Die NPC Textur wärend der Laufzeit editieren.
Dazu müsste ich wegen des nicht funktionierenden virtuellen screens auf der Pandora, die Texturen, welche geändert werden irgendwie mit loadsprite2mem
beim Laden eines Levels speichern. Die Gesichts Teile müsste ich dann auch vorher mit derselben Methode laden.
Dann könnte man beim Gesichts update leicht die gesichtsteile auf die Grundtextur auftragen und mit mem2sprite abschließen.

2. NPCs ein, aus 4 Polygonen bestehendes, Gesichtsplain mitgeben, dass dann mit dem NPC zusammen gezeichnet wird ( könnte die genaue positionierung mit pushmatrix etc. realisieren ). Dazu würde ich dann nur die Gesichtsteile und ein paar wenige Gesichtsplains in den Speicher laden.
Bei der ganzen Sache muss natürlich auch der Z Buffer bei der Pandora mitspielen, damit das Gesicht nicht rumflackert.

Was glaubt ihr, ist die bessere Methode?




11
GLBasic - de / Schon wieder eine RAM Frage
« on: 2015-Sep-24 »
Hallo,

ich habe Unterschiede beim Speicherverbrauch zwischen Debug Modus und normaler Kompilation.

Beim Testen mit dem Debugger fiel mir auf, dass mein Speicherverbrauch sich
erwartungsgemäß geändert hat ( weniger Polygone auf dem Schirm, weniger Speicherbelastung &u. ).


Wenn ich es im normalen Modus kompiliere und teste,
ist der Speicherverbrauch deutlich geringer als im Debug Modus, wenn ich die Karte neu geladen habe,
wächst aber nach einer Reihe von Polygon Erstellungen und Löschungen ( Karten scrolling ) auf den Wert,
welchen ich im Debug Modus beim Laden der Karte beobachtet habe und verhält sich danach
auch so wie im Debug Modus.

Weis jemand woher dieser anfängliche Speichervorteil vom normalen Modus im vergleich zum Debug Modus
kommen kann?

PS: Es wäre auch schön, wenn man überprüfen könnte, ob eine Objekt Nummer frei ist, oder
schon belegt wurde ( durch loadobj, objstart etc. )




12
Hello, I have been experimenting with 3D Rails,
I wanted to generate an editor where you set some points
and the whole track is interpolated circular.



My greatest problem is detecting wether the track piece should be curved convex or concave.
Right now I have just set it to alternate between the two forms each trackpiece.

Did anyone made some experience on this subject yet?

13
#####UPDATE########
####Problem gelöst#####
Ich habe vergessen die Terrain Polygone zu löschen.
Das System war zwar so aufgebaut, dass ältere Polygonmodelle überschrieben wurden,
aber wenn sie nicht überschrieben wurden aber freigegeben wurden,
war das alte Polygon noch so lange im Speicher, bis es durch eine, voll durch Polygone gefüllte, Situation wieder
überschrieben wurde. Die Anzahl der Polygon 3D Objekte ist somit immer bis zur maximalen Polygonzahl gewachsen :-[.
Das selbe galt für die 3D Boxen.


Hallo,
ich habe eben den Ladeprozess meiner Engine umgeschrieben,
vorher habe ich einfach alle Objekte und Texturen versch. TileSets und ObjectSets geladen.

Jetzt habe ich es so umgeschrieben, dass die Karte einmal beim Speichern nach allen unterschiedlichen Objekten und
Texturen die auf der ganzen Karte sind abgeparst wird und die Liste zur Karte hinzugefügt wird.

Dateien aus der Liste werden beim laden der Karte geladen,
sind weniger als die maximal Ladbaren Objekte oder Texturen auf der Karte,
werden die nicht benötigten Sprites und Objekte mit Loadsprite "" , id und X_Objstart id ; X_ObjEnd gelöscht.

Wenn die erste Karte läuft ist der Arbeitsspeicher verbrauch geringer als vorher, wie zu erwarten war.
Wenn ich die Karte wechsle, steigt der Arbeitsspeicher verbrauch bei fast jedem Wechsel an, ( wenn man immer zwischen den beiden identischen Karten wechselt ), ab einem bestimmten Wert scheint sich der ArbeitsSpeicher Verbrauch relativ stabil zu halten.
Ist das normal bei GLBasic unter Windows,
oder sollte man mit LoadSprite "" , id / X_Objstart id ; X_ObjEnd aufpassen?

Update:

Mir ist aufgefallen, dass der Anstieg im Speicher nur dann auftritt, wenn neue 3d faces für das Terrain erstellt werden.
Dabei müsste die Anzahl und Speichergröße der Terrain faces immer gleich bleiben pro Karte und Sichtweite,
denn mit X_Objstart neu erstellte Faces überschreiben die, welche aus dem Scroll Fenster rausgefallen sind.
Die gleichbleibende Gesamtzahl der Tiles zeigt mir, dass es auch so läuft.

Auch merkwürdig, wenn ich eine Karte mit deutlich geringerer Anzahl an unterschiedlichen Objekten und Sprites
als bei der vorherigen lade, verändert sich der Speicherverbrauch überhaupt nicht.

Habe peinlich darauf geachtet jedes Lokale Array wieder freizugeben vor Funktionsende,
was kann noch zu einem Memory Leak führen?

[/spoiler]



14
Edit2: This code is for non rotated boxes only, which are aligned to the Worlds X Z and Y coordinates.
And have only 90 degree corners.

Edit:
Kanonet has done a nice optimized code of my brute force attempt,
so I am pinning his post here for people who need
that code:

Dam, instead of going to sleep you guys made me do this:
Code: GLBasic [Select]
FUNCTION DistanceBoxPoint#: cX# , cY# , cZ# , bXL# , bXR# , bYD# , bYU# , bZF# , bZB#
        cX = IIF( cX<bXL, cX-bXL, IIF( cX>bXR, cX-bXR, 0 ) )
        cY = IIF( cY<bYD, cY-bYD, IIF( cY>bYU, cY-bYU, 0 ) )
        cZ = IIF( cZ<bZF, cZ-bZF, IIF( cZ>bZB, cZ-bZB, 0 ) )
        RETURN cX * cX + cY * cY + cZ * cZ
ENDFUNCTION
Same interface as your function and should give the same results, while having obvious advantages. I love the fun of finding algorithms.  :booze:

My brute force attempt was like this:

Code: GLBasic [Select]
// cX = 3DPointX , cY = 3DPointY , cZ = 3DPointZ
// bXL (box left side, the smallest x coordinate of the box ) , bXR ( box right side, the greatest x coordinate of the box)
// bYD (box bottom side, the smallest y coordinate of the box ) , bYU ( box top side, the greatest y coordinate of the box)
// bZF (box front side, the smallest t coordinate of the box ) , bZB ( box back side, the greatest z coordinate of the box)
FUNCTION DistanceBoxPoint#: cX# , cY# , cZ# , bXL# , bXR# , bYD# , bYU# , bZF# , bZB#
        LOCAL dist# , dist1# , dist2#
        LOCAL distX# , distY# , distZ#
        LOCAL boxYU# , boxYD# , boxXL# , boxXR# , checkX# , checkY#
        distX = 0 ; distY = 0 ; distZ = 0
        FOR i2 = 0 TO 2
                IF i2 = 0 // x and z
                        checkX = cX ; checkY = cZ
                        boxYU = bZB ; boxYD = bZF ; boxXR = bXR ; boxXL = bXL
                ENDIF
                IF i2 = 1 // x and y
                        checkX = cX ; checkY = cY
                        boxYU = bYU ; boxYD = bYD ; boxXR = bXR ; boxXL = bXL
                ENDIF
                IF i2 = 2 // z and y
                        checkX = cZ ; checkY = cY
                        boxYU = bYU ; boxYD = bYD ; boxXR = bZB ; boxXL = bZF
                ENDIF
                dist1 = 0 ; dist2 = 0
                IF checkX < boxXL AND checkY > boxYU // Left top area
                        dist1 = checkX - boxXL ; dist2 = checkY - boxYU
                ENDIF
                IF checkX >= boxXL AND checkX <= boxXR AND checkY > boxYU // top area
                        dist1 = 0 ; dist2 = checkY - boxYU
                ENDIF
                IF checkX > boxXR AND checkY > boxYU // Right top area
                        dist1 = checkX - boxXR ; dist2 = checkY - boxYU
                ENDIF
                IF checkY >= boxYD AND checkY <= boxYU AND checkX > boxXR // right area
                        dist1 = checkX - boxXR ; dist2 = 0
                ENDIF
                IF checkX > boxXR AND checkY < boxYD // Right down area
                        dist1 = checkX - boxXR ; dist2 = checkY - boxYD
                ENDIF
                IF checkX >= boxXL AND checkX <= boxXR AND checkY < boxYD // down area
                        dist1 = 0 ; dist2 = checkY - boxYD
                ENDIF
                IF checkX < boxXL AND checkY < boxYD // Left down area
                        dist1 = checkX - boxXL ; dist2 = checkY - boxYD
                ENDIF
                IF checkY >= boxYD AND checkY <= boxYU AND checkX < boxXL // left area
                        dist1 = checkX - boxXL ; dist2 = 0
                ENDIF
                IF dist1 <> 0
                        IF i2 = 0 ; distX = dist1 * dist1 ; ENDIF
                        IF i2 = 1 ; distX = dist1 * dist1 ; ENDIF
                        IF i2 = 2 ; distZ = dist1 * dist1 ; ENDIF
                ENDIF
                IF dist2 <> 0
                        IF i2 = 0 ; distZ = dist2 * dist2 ; ENDIF
                        IF i2 = 1 ; distY = dist2 * dist2 ; ENDIF
                        IF i2 = 2 ; distY = dist2 * dist2 ; ENDIF              
                ENDIF
        NEXT
        dist = ( distX + distY + distZ )
        // return an not square rooted 3D distance ( if you want the real distance you have to use sqr() on the value this
        // function returns )
        RETURN dist
ENDFUNCTION
 

15
3D-snippets / Glue an object to another
« on: 2015-Jun-10 »
Hello,

If you want to glue an object to another one, here is a nice code snipped for you:

Code: GLBasic [Select]
// --------------------------------- //
// Project: genericGlue
// Start: Wednesday, June 10, 2015
// IDE Version: 12.312

TYPE vec3D
        x#
        y#
        z#
ENDTYPE

TYPE object
        objID% // could store a previously loaded objects ID
        x#
        y#
        z#
        anX#
        anY#
        anZ#
        glueDist#
        glueInit%
        rootGlueObjAnY#
        myOldAny#
        glueObjAnY#
        glueObject%
ENDTYPE

GLOBAL Objects[] AS object

main()


FUNCTION main:
        LOCAL ObjectMax% , finished%
        ObjectMax = 10 ; finished = 0
        DIM Objects[ObjectMax]
        // create some objects
        WHILE finished = 0
                // you could change glueDist and glueObjAnY before the calculateglue() call for relative movements
                calculateGlue()
                // draw those objects here
        WEND
ENDFUNCTION

FUNCTION calculateGlue:
        LOCAL rotate AS vec3D
        FOR i = 0 TO ObjectMax - 1 // parse through all objects
                IF Objects[i].glueInit = 0 AND Objects[i].glueObject > -1 // initialise gluing
                        // get glue Dist by using pythagoras on the x and z difference between object A and object B
                        Objects[i].glueDist = SQR( ( POW( ( Objects[i].x - Objects[Objects[i].glueObject].x ) , 2 ) + POW( ( Objects[i].z - Objects[Objects[i].glueObject].z ) , 2 ) ) )
                        // get the original Y Angle of the object where object A is glued to ( of object B )
                        Objects[i].rootGlueObjAnY = Objects[Objects[i].glueObject].anY
                        // save the original Y Angle of tobject A
                        Objects[i].myOldAnY = Objects[i].anY
                        // get the Y Angle between Object A and Object B
                        Objects[i].GlueObjAnY = 360 - ( ATAN( ( Objects[i].z - Objects[Objects[i].glueObject].z ) , ( Objects[i].x - Objects[Objects[i].glueObject].x ) ) + 180 )
                        // get the Y difference between object A and object B
                        Objects[i].yDistRoot = Objects[i].y - Objects[Objects[i].linkEvent].y
                        // set glue initialisation variable
                        Objects[i].glueInit = 1
                ENDIF
                IF Objects[i].glueInit > 0 AND Objects[i].glueObject > -1 // calculate coordinates for a glueing initialised object
                        // calculate a vector which originates in ( 0 , 0 , 0 ) and has the Objects new X and Z positions as endcoordinates
                        rotate.x = Objects[i].glueDist * COS( 360 - ( Objects[i].glueObjAnY - ( Objects[i].rootGlueObjAnY - Objects[ Objects[i].glueObject].anY ) ) )
                        rotate.z = Objects[i].glueDist * SIN( 360 - ( Objects[i].glueObjAnY - ( Objects[i].rootGlueObjAnY - Objects[ Objects[i].glueObject].anY ) ) )
                        rotate.y = Objects[i].yDistRoot
                        // rotate the vector, which is stored as rotate ( the call order is important here )
                        RotateCoordAroundOrigin( 0 , 360 - ( Objects[ Objects[i].glueObject].anY + 180 ) , 0 , rotate )
                        RotateCoordAroundOrigin( 360 - ( Objects[ Objects[i].glueObject].anZ + 180 ) , 0 , 0 , rotate )
                        RotateCoordAroundOrigin( 0 , 0 , 360 - ( Objects[ Objects[i].glueObject].anX + 180 ) , rotate )
                        // add the rotated vector to the real origin ( the real origin is at the coordinates of object B )
                        Objects[i].x = Objects[Objects[i].glueObject].x + rotate.x
                        Objects[i].z = Objects[Objects[i].glueObject].z + rotate.z
                        Objects[i].y = Objects[Objects[i].glueObject].y + rotate.y
                        // finally also change X and Z angles of the object
                        Objects[i].anY = Events[eNr].myOldAnY - ( Events[eNr].rootGlueObjAnY - Events[Events[eNr].glueObject].anY )
                        Objects[i].anX = Events[Events[eNr].glueObject].anX
                        Objects[i].anZ = Events[Events[eNr].glueObject].anZ
                ENDIF
        NEXT
ENDFUNCTION

FUNCTION RotateCoordAroundOrigin: rotx# , roty# , rotz# , point AS coord // point is called by reference
        LOCAL result AS vec3D
        result = point
        IF rotx > 0
                result.y = point.y * COS(rotx) - point.z * SIN(rotx) ; result.z = point.y * SIN(rotx) + point.z * COS(rotx)
        ENDIF
        IF roty > 0
                result.x = point.x * COS(roty) + point.z * SIN(roty) ; result.z = point.x * SIN(roty) + point.z * COS(roty)
        ENDIF
        IF rotz > 0
                result.x = point.x * COS(rotz) - point.y * SIN(rotz) ; result.y = point.x * SIN(rotz) + point.y * COS(rotz)
        ENDIF
        point = result
ENDFUNCTION
 

With the Object will always stay in the same position and angle to the object it has been glued onto,
no matter how the object which "carries" the glued object turns.

I used this to glue my event objects together, to make even more interesting Bossfights and it works nicely.
You just need to preload 2 objects and set the variable glueInit to 1 and the calculate glue function will do the rest.
Of course you will also need to draw those objects using the information stored in the object type,
if you want some visible results.

You can also change the glueDist and glueObjAnY Variables over time, to make one Object orbit the other one or do other cool
stuff with it.



Pages: [1] 2