Menu

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.

Show posts Menu

Topics - nabz32

#1
Hi, ich habe erst letztens die nützliche Tastenkombination alt + Pfeiltaste links gefunden, mit der man einfach zurückgehen kann, leider hat alt + Pfeiltaste rechts zum Vorwärtsgehen dann nicht funktioniert.

Ich lese hier auch von strg + leer, was bei mir anscheinend überhaupt nichts tut, bin ich zu dumm, oder gibt es irgendwo ein verstecktes Readme, in welcher alle Tastenkombinationen des GLBasic Editors aufgelistet sind?
#2
Hi,

I just bought the new glbasic in steam yesterday.
I noticed, That my game runs a bit slower than before,
Also debug mode is choppy.

But a recursive function that crashed the game only when debugging
Works now in debug mode.

Any new funtionality in v15?

I only noticed That you can build 64Bit executables and That the IDE
Looks a Bit weird at 4K resolution.


#3
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.

#4
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?
#5
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 )



#6
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?
#7
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?

#8
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?


#9
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


#10
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 )?

#11
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.

#12
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?



#13
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. )



#14
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?
#15
#####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]


#16
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:

Quote from: kanonet on 2015-Aug-21
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

#17
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.


#18
Bin grade dabei eine Stelle in meinem Spiel zu debuggen,
wegen eines Unhandled_Exception_Violation errors könnte ich ausgaben bevor dieser Fehler kommt
ggut in der Konsole gebrauchen, leider scheint STDOUT nichts auszugeben,
muss ich erst ein LogFile manuell befüllen, oder kann man STDOUT doch irgendwie dazu nutzen?
#19
Hallo,

ich bin kurz davor den ersten Beta Test von Reggie World zu starten,
habe leider keine Ahnung wie ich eine fertige PND erstelle.

Im Momment läufts nur, wenn ich die PandoraEXE.pnd zusammen mit dem Media Verzeichniss zusammen
in zB. den Desktop Ordner der Pandora verschiebe.

Es ist ja auch noch eine PND mit dem Projektnamen in einem vorgelagerten Ordner vorhanden, kann man die irgendwie verwenden?
#20
Ich versuche grade sowas ähnliches wie Sprite Lamp
in GLBasic hinzubekommen.

Leider bekomme ich bei den Höhenwerten hLU , hRU , hLD , hRD in
der Funktion drawLitSprite immer Null heraus, sodass ich nichtmal anfangen kann überlegungen
bezüglich der X und Z Winkel anX und anZ in Relation zur Lichtquellen Position anzustellen.

Code (glbasic) Select
CONSTANT LightsMax = 10
CONSTANT SpriteMax = 100

TYPE vRGB
r% ; g% ; b%
ENDTYPE

TYPE light
color AS vRGB
range% // range of light ( Radius! )
kind% // kind of light ( other light reduction kinds till the end of the light range
exist%
x%
y%
ENDTYPE

TYPE sprite
srcTex$
srcH$
srcS$
iD%
x% ; y%
ENDTYPE

GLOBAL LightMap[] AS vRGB
GLOBAL Ambient AS vRGB
GLOBAL Lights[] AS light


main()


FUNCTION newSprite AS sprite: any AS sprite , iDG , sT$ , sH$ , sS$ , x , y
any.srcTex$ = sT$ ; any.srcH$ = sH$ ; any.srcS$ = sS$ ; any.iD = iDG ; any.x = x ; any.y = y
ENDFUNCTION



FUNCTION main:
LOCAL width% , height% , white AS vRGB , blue AS vRGB , red AS vRGB , ball AS sprite
LOCAL mX% , mY% , b1% , b2%
width = 320 ; height = 240
Ambient.r = 40 ; Ambient.g = 40 ; Ambient.b = 40
white.r = 255 ; white.g = 255 ; white.b = 255
blue.r = 120 ; blue.g = 120 ; blue.b = 255
red.r = 60 ; red.g = 255 ; red.b = 60
newSprite( ball , 100 , "bBall.bmp" , "bBallH.bmp" , "bBallS.bmp" , 160 , 120 )
SETCURRENTDIR("Media/Sprites") // go to media files
DIM LightMap[width][height] ; DIM Lights[LightsMax]
Lights[0].exist = TRUE ; Lights[0].x = 160 ; Lights[0].y = 120 ; Lights[0].range = 250 ; Lights[0].color = red
// Lights[1].exist = TRUE ; Lights[1].x = 160 ; Lights[1].y = 120 ; Lights[1].range = 50 ; Lights[1].color = blue
// Lights[2].exist = TRUE ; Lights[2].x = 60 ; Lights[2].y = 60 ; Lights[2].range = 50 ; Lights[2].color = white
WHILE NOT KEY( 30 )
MOUSESTATE mX , mY , b1 , b2
Lights[0].x = mX ; Lights[0].y = mY
// updateLightMap( width , height , Ambient )
X_MAKE2D
// drawLightMap( width , height )
drawLitSprite( ball )
SHOWSCREEN
WEND
ENDFUNCTION

FUNCTION drawLitSprite: spr AS sprite
LOCAL w% , h% , w2% , h2% ,  tMap%[] , hMap%[] , x% , y%
LOCAL hLD# , hRD# , hLU# , hRU# , hU# , hD# , hL# , hR# , anX# , anZ#
LOCAL lAllow% , rAllow% , dAllow% , uAllow% , dist# , clr AS vRGB , ok%
ok = LOADSPRITEMEM( spr.srcTex$ , w2 , h2 , hMap[] )
IF NOT ok THEN RETURN FALSE
ok = LOADSPRITEMEM( spr.srcTex$ , w , h , tMap[] )
IF NOT ok THEN RETURN FALSE
IF w2 <> w OR h2 <> h THEN RETURN FALSE // hMap has to be the same size as the texture size for this to work...
clr.r = Ambient.r ; clr.g = Ambient.g ; clr.b = Ambient.b
FOR i = 0 TO BOUNDS( hMap[] , 0 ) - 1
x = MOD( i , w ) ; y = i / w ;
IF bAND(ASR( hMap[ i ],24), 0xff) <> 0x00 // not pink "alpha" color...
hLD = ( bAND( hMap[ i ], 0x00ff00) / 255.0 ) * 100.0
hRD = ( bAND( hMap[ cB( ( x + 1 ) , 0 , ( w - 1 ) ) + ( y * w ) ] , 0xff ) / 255.0 ) * 100.0 // in debug I always get zero for those heights, also when I try to look at the value of hMap[ i ] I allways get the same value...
hLU = ( bAND( hMap[ x + ( cB( ( y + 1 ) , 0 , ( h - 1 ) ) * w ) ] , 0xff ) / 255.0 ) * 100.0
hRU = ( bAND( hMap[ cB( ( x + 1 ) , 0 , ( w - 1 ) ) + ( cB( ( y + 1 ) , 0 , ( h - 1 ) ) * w ) ] , 0xff ) / 255.0 ) * 100.0
hU = hLU + ( hRU - hLU ) / 2.0 ; hD = hLD + ( hRD - hLD ) / 2.0 ; hL = hLD + ( hLU - hLD ) / 2.0 ; hR = hRD + ( hRU - hRD ) / 2.0 // mean values
anZ = ATAN( ( hD - hU ) , 10.0 ) ; anX = ATAN( ( hL - hR ) , 10.0 ) // getting angles of steepness in right and up direction
lAllow = FALSE ; rAllow = FALSE ; dAllow = FALSE ; uAllow = FALSE
IF anX <= 0 THEN lAllow = TRUE ; IF anX >= 0 THEN rAllow = TRUE // light affecting this angle at all ?
IF anZ <= 0 THEN dAllow = TRUE ; IF anZ >= 0 THEN uAllow = TRUE // light affecting this angle at all ?
FOR i2 = 0 TO LightsMax - 1
IF Lights[i2].exist
IF ( Lights[i2].x > spr.x + x AND rAllow ) OR ( Lights[i2].x < spr.x + x AND lAllow ) OR ( Lights[i2].y > spr.y + y AND uAllow ) OR ( Lights[i2].y < spr.y + y AND dAllow ) // light affecting this angle at all ?
dist = SQR( POW( ( ( spr.x + x ) - Lights[i2].x ) , 2 ) + POW( ( ( spr.y + y ) - Lights[i2].y ) , 2 ) )
dist = Lights[i2].range - dist
IF dist > 0
dist = dist / ( Lights[i2].range / 2.0 )
dist = cBR( dist , 0 , 0.5 )
clr.r = clr.r + ( Lights[i2].color.r - clr.r ) *dist ; clr.g = clr.g + ( Lights[i2].color.g - clr.g ) * dist ; clr.b = clr.b + ( Lights[i2].color.b - clr.b ) * dist
ENDIF
ENDIF
ENDIF
NEXT
ENDIF
IF bAND(ASR(tMap[ i ],24), 0xff) <> 0x00
clr.r = clr.r - ( bAND( tMap[ i ], 0xff ) - clr.r ) / 2.0
clr.g = clr.g - ( bAND( ASR( tMap[ i ] , 8 ) , 0xff ) - clr.g ) / 2.0
clr.b = clr.b - ( bAND( ASR( tMap[ i ] , 16 ) , 0xff ) - clr.b ) / 2.0
SETPIXEL spr.x + x , spr.y + y , RGB( clr.r , clr.g , clr.b )
ENDIF
clr.r = Ambient.r ; clr.g = Ambient.g ; clr.b = Ambient.b
NEXT
DIM hMap[0] ; DIM tMap[0]
ENDFUNCTION

FUNCTION cB: value , minimum , maximum // in bounds checker
IF minimum > maximum THEN SWAP minimum , maximum
IF value < minimum THEN RETURN minimum
IF value > maximum THEN RETURN maximum
RETURN value
ENDFUNCTION

FUNCTION cBR#: value# , minimum# , maximum# // in bounds checker for floats
IF minimum > maximum THEN SWAP minimum , maximum
IF value < minimum THEN RETURN minimum
IF value > maximum THEN RETURN maximum
RETURN value#
ENDFUNCTION


Edit:
Habe grade gemerkt, dass ich die Quelldatei für die heightmap falsch angegeben hatte... :blink:
Kein Wunder dass da nix rauskam...
Mal schauen was daraus wird.