Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 838 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
internal Cache #217097
07/21/08 10:59
07/21/08 10:59
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline OP
User
RedPhoenix  Offline OP
User
R

Joined: Jan 2007
Posts: 651
Germany
Hi conitec,

I have a project where it's necessary to save entities or pictures to files and later load these files again. The problem with that is, that when I load eg. an entity with ent_create it takes the "old file" (which is not existing on the HD anymore) rather than the actual saved file. The manual says:
Quote:
Zum Beschleunigen des Erstellens weiterer Entities wird die Entity-Datei in einem internen Cache gespeichert. Dieser Cache wird durch level_load geleert.


I'd therefore like to have a function that can remove or add files to this internal cache, or a function that can clean the cache without having to reload the hole level.

Re: internal Cache [Re: RedPhoenix] #217099
07/21/08 11:08
07/21/08 11:08
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
These functions already exist.
Look for ent_purge and ent_preload in the manual.

Dark_Samurai


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: internal Cache [Re: Dark_samurai] #217100
07/21/08 11:11
07/21/08 11:11
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline OP
User
RedPhoenix  Offline OP
User
R

Joined: Jan 2007
Posts: 651
Germany
I know about these functions, but they only affect an Entity by it's pointer and
1: I don't have the pointers to privious created entities
2: Every object in my environment is cloned, that means ent_purge would only free the unique mesh but not the file entry in the cache.

Re: internal Cache [Re: RedPhoenix] #217101
07/21/08 11:13
07/21/08 11:13
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
Quote:

level_mark()
level_free()
Löchst den Nexus teilweise, das heisst, der Level-Cache, der die Entity-Dateien enthält wird geleert. level_mark() markiert eine Cache-Position und level_free() löscht sämtliche später geladenen Dateien aus dem Cache. Diese Anweisung kann zum vorübergehenden Laden von Entities verwendet werden, ohne dass Nexus-Speicher verbraucht wird.

Parameter:
name - Name der Level-, Modell-, oder Terraindatei.
Bemerkungen:
Wird ein neues Level geladen, wird der Level-Cache komplett gelöscht.
Der Umfang des Caches hängt von der -nx-Kommandozeilen-Option ab.
Keine Entity darf eine Datei verwenden, die aus dem Cache entfernt wurde. Sämtliche Entities, die hinter level_mark() erstellt wurden, müssen vor level_free() entfernt werden.
Geschwindigkeit:
Langsam
Beispiel:
level_mark(); // mark a cache position
you = ent_create("test.mdl",vector(0,0,0),NULL);
...
ptr_remove(you);
level_free(); // remove test.mdl from the cache



Last edited by TechMuc; 07/21/08 11:13.
Re: internal Cache [Re: TechMuc] #217102
07/21/08 11:23
07/21/08 11:23
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline OP
User
RedPhoenix  Offline OP
User
R

Joined: Jan 2007
Posts: 651
Germany
Hey why didn't I know about them???

This is already a help thanks for showing these functions! But I'd like to have even more control of the cache. What I have in mind would be a function that works like ent_purge, but deletes a single file from the cache instead of freeing an entity.

Re: internal Cache [Re: RedPhoenix] #253144
02/23/09 01:59
02/23/09 01:59
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I know this is a very old thread, but what happened to it? I'd like to know what happened
to RedPheonix's request for a function to remove a file (read .MDL file) from the cache?

Using the existing level_mark/level_free functions is too coarse for many situations,
we just need finer control of nexus contents PLEASE.

What we REALLY need some function to allow us to remove EVERY trace of a of a
no-longer required entity, without disturbing any that have been created since.
We can create entities on-the-fly, so why cant we TRULY reclaim all the resources
that the creation consumed.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: internal Cache [Re: EvilSOB] #253230
02/23/09 16:14
02/23/09 16:14
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Any model has many cache entries, so it's not possible to remove individual models from the cache. It's only possible to mark and free a certain cache position.

Re: internal Cache [Re: jcl] #253247
02/23/09 17:57
02/23/09 17:57
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Dammit, thanks anyway. It was worth a try.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Moderated by  aztec, 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