Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 396 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Nexus Crash when creating terrains #391741
01/15/12 15:25
01/15/12 15:25
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Hi there.. i´m struck in a problem..

I want to create 10x10 terrains.
Each terrain should have 250x250 cells with a cellsize of 10.

This is the code to is:
Click to reveal..

Code:
#include <acknex.h>
#include <d3d9.h>
#include <windows.h>

#include "syst_default.c"





var levelbreite, levelhoehe;
var camera_zoom = 1200;

STRING* str_result_filename = "";

BMAP*   bm_levelmap;

COLOR*  pixelcolor = {red=1; green=1; blue=1;}

ENTITY* mapsky;
ENTITY* mapterrains[101];



//==========================================================================================================================
//==========================================================================================================================
//
//                                    INCLUDES
//
//==========================================================================================================================
//==========================================================================================================================
#include "global_structs.c"


//==========================================================================================================================
//==========================================================================================================================
//
//                                    LOADING TERRAINS
//
//==========================================================================================================================
//==========================================================================================================================
void create_terrains(var x_num, var y_num)
{
	var ix, iy, icount, ivertcount, icenterx, icentery, camset;
	camset = 0;
	icount = 1;
	icenterx = (x_num/2);
	icentery = (y_num/2);
	BMAP* terraintest = bmap_createblack(1024,1024,24);
	bmap_fill(terraintest, vector(random(255), random(255), random(255)), 100);
	
	//terrains laden
	for(iy=0; iy<x_num; iy++)
	{
		for(ix=0; ix<y_num; ix++)
		{
			if(sys_memory > 500000)
			{error("Mehr als 500MB sind besetzt!");}
			
			if(ix>icenterx && iy>icentery && camset == 0)
			{
				vec_set(camera.x, vector((ix-1)*2500, (iy-1)*2500, camera_zoom));
				camset = 1;
			}
			mapterrains[icount] = ent_createterrain(terraintest, vector(ix*2500,iy*2500,100), 250, 250, 10);
			icount ++;
			wait(1);
		}
	}
	
	//vertexe setzen
	for(icount=1; icount<26; icount++)
	{
		for(iy=0; iy<x_num; iy++)
		{
			for(ix=0; ix<y_num; ix++)
			{
				
			}
		}
	}
}



//==========================================================================================================================
//==========================================================================================================================
//
//                                    DUMMY MAIN
//
//==========================================================================================================================
//==========================================================================================================================
void main()
{
	nexus = 500;
	video_mode = 12;
	d3d_antialias = 9;
	level_load(NULL);
	sun_light = 0;
	wait(2);
	mapsky = ent_createlayer("sky_2+6.tga", SKY | CUBE | SHOW, 0);
	
	vec_set(camera.x,  vector(0,0,1200));
	vec_set(camera.pan, vector(0,-45,0));
	
	create_terrains(10, 10);
}




It works well with.. let´s say 5x5 terrains.. but with 10x10 terrains, i always get a "nexus too small".
I asked a friend if that´s possible.. but he said that something is strange, cause 250*10*100 = 250000*56byte, wich are a few MB, and not my nexus size of 500MB ._.


What could be wrong?

Last edited by Espér; 01/15/12 15:26.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Nexus Crash when creating terrains [Re: Espér] #391828
01/16/12 14:00
01/16/12 14:00
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
hi

"nexus" is read only, thus "nexus = 500;" does not work.

put into 'preferences'->'command line options' "-nx 200" or "-nx 500" (but going over 300 is not recommended), and use Test Run (only this takes into account command line options).

or make a dummy .wmb where you can set nexus, and compile your project from WED.

it solved my similar problems.

Last edited by sivan; 01/16/12 14:00.

Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Nexus Crash when creating terrains [Re: sivan] #391834
01/16/12 15:20
01/16/12 15:20
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
The code doesnt really show much.

But try starting it up with 5x5 full-sized terrains.
If its running, look at the F11 debug panel and see if anything
is using HUGE amounts of memory...

I suspect it may be a TEXTURE memory usage issue.
Too many skins per terrain or something like that...

(yes I know textures arent stored in nexus, but just play along)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Nexus Crash when creating terrains [Re: EvilSOB] #391908
01/16/12 21:24
01/16/12 21:24
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
'-nx 200' just makes everything extremely slow.. and Acknex Engine crashes with a Script Crash, Runtime error and after all a "Acknex is not answering"-Shutdown

i tried 5x5.. works..
The terain uses a 128x128 Texture
Code:
BMAP* terraintest = bmap_createblack(128,128,24);


I don´t think that uses much memory ^^


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Nexus Crash when creating terrains [Re: Espér] #391957
01/17/12 17:12
01/17/12 17:12
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
hmmm... OK. Not much memory at all...

But did you look at the debug panel anyway? Did anything look 'odd'?

And how about re-createing the HMP file, "just in case" it is corrupted somehow.

Otherwise Im out of ideas...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Nexus Crash when creating terrains [Re: EvilSOB] #391976
01/17/12 20:20
01/17/12 20:20
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
i don´t use HMP.. i create the terrain at runtime..


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<

Moderated by  HeelX, Spirit 

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

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

Powered by UBB.threads™ PHP Forum Software 7.7.1