|
2 registered members (AndrewAMD, NorbertSz),
5,730
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Are you doing secret stuff with unassigned eflags flags?
[Re: HeelX]
#349128
12/04/10 08:47
12/04/10 08:47
|
Joined: Jul 2008
Posts: 894
TechMuc
User
|
User
Joined: Jul 2008
Posts: 894
|
Your logic isn't correct Christian.. 2 Points: 1) Even if you can use the flags: In this case it would be possible for all users ==> The unused emasks flags could be used by the end-user and therefore would lead to conflicts with your code. 2) Even if it would be possible now: Your code wouldn't be "foreward compatible" (your code wouldn't work in a future 3D-Gamestudio Version). Solutions: 1) Some kind of init function (I'm sure you have one?). E.g. heelx_use_skill(33); instead of useing of predefined skill.. 2) ATTENTION, SLOW OVERHEAD (ofc not very efficient etc.): Create a Linked List / Dictionary (any possible ADT which applys to your situation) which manages any additional information you need.. I would not recommend this method if you have to manage a lot of entities (slow searching) or you don't want to use any skill (skill contains pointer to handling structure). ahh why am i writing.. i'm sure you know it for yourself
Last edited by TechMuc; 12/04/10 08:48.
|
|
|
Re: Are you doing secret stuff with unassigned eflags flags?
[Re: TechMuc]
#349142
12/04/10 11:52
12/04/10 11:52
|
Joined: Jul 2001
Posts: 6,904
HeelX
OP
Senior Expert
|
OP
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
Hi TechMuc, thanks for your input. I decided finally that the user has to sacrifice one skill: Which can be changed easily (just replace skill100 with the skill you like). And I use the follwing public flags:
#define SOLID (1<<0) // Solid surface
#define BINARYALPHA (1<<1) // Solid surface with sharp holes (if alpha < 50%)
#define SOFTALPHA (1<<2) // No AO-contribution; soft alpha masked
and one private flag (used by system):
#define _RECOGNIZED (1<<8) // If true, surface has been recognized
I think this is for the moment the best solution. Using a skill parameter beside that is another possible solution. I will think about it, thanks for sharing your thoughts  The problem I see is twofolded: First, I think that most people aren't adressing skills as an array and rely mostly on the "old" fashioned way. So there might be confusion if they have to pass the skill number based on a 0-index (zero; for array adressing) instead of a 1-index basis (define like usage like in c-script). I could say "pass the numnber for skills 1...100", but that would be inconsistent and very confusing. So, defining a skill might be the most compatible solution for everyone. Since there aren't really much events in Gamestudio (like when ptr_remove is called on an entity or so), I can't use a passive solution that keeps a parallel datastructure. [EDIT] Superku told me about the on_ent_remove event.. didn't knew that!
Last edited by HeelX; 12/04/10 12:32.
|
|
|
Re: Are you doing secret stuff with unassigned eflags flags?
[Re: HeelX]
#349144
12/04/10 12:13
12/04/10 12:13
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
You know that you can "overwrite" ptr_remove with a macro that does your cleanup stuff and then calls the real ptr_remove function?
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Are you doing secret stuff with unassigned eflags flags?
[Re: WretchedSid]
#349149
12/04/10 12:29
12/04/10 12:29
|
Joined: Jul 2001
Posts: 6,904
HeelX
OP
Senior Expert
|
OP
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
You know that you can "overwrite" ptr_remove with a macro that does your cleanup stuff and then calls the real ptr_remove function? That is on the first sight a real cool idea. But on the other hand not so wise in the end. If I would do that, my solution would'nt be loosely coupled to the users's project, because I would - hijack his "engine"-functions
- have problems if he would like to do the same (same problem as with using the eflags)
- I would have serious issues with a level_load (ptr_remove is maybe called, but in the engine and not from Lite-C)
So, I don't think this is a good solution in comparison with the skill-method. I really want to have a loosely-coupled standalone solution that isn't aggressive in terms of usage ergonomics and engine-hacking  [EDIT] Superku told me about the on_ent_remove event, didn't knew that. If I have to store more data for each entity, maybe this will be a solution... gnaaarr
Last edited by HeelX; 12/04/10 12:33.
|
|
|
|