Difference between revisions of "Talk:Presence flag"
Line 168: | Line 168: | ||
:::::So my idea is, to define a tuples of kind (object_id,condition) into a lex file. If condition is true, all objects of that type use the low poly model. Another point is, that 1 bit reduces the condition list to half size. | :::::So my idea is, to define a tuples of kind (object_id,condition) into a lex file. If condition is true, all objects of that type use the low poly model. Another point is, that 1 bit reduces the condition list to half size. | ||
::::: -- [[User:Wiimm|Wiimm]] ([[User talk:Wiimm|talk]]) 13:30, 3 January 2020 (UTC) | ::::: -- [[User:Wiimm|Wiimm]] ([[User talk:Wiimm|talk]]) 13:30, 3 January 2020 (UTC) | ||
+ | |||
+ | ::::::* Since most objects have to be visible at all times, most of them can't use any other value than 0x3F to not affect gameplay. Changing the presence flag to also support low-poly model loading will allow for further reduction in CPU/GPU cycles. | ||
+ | ::::::* That's indeed a flaw I did not think about when I proposed this idea. However, if I remember correctly, the model to load is stored in memory per object, rather than by object type. It should then be trivial to have different versions of the object loaded at the same time. This is also the advantage this approach has over modifying the brres file. | ||
+ | ::::::It will indeed cost a bit, but in exchange this functionality can be used for more objects and authors will have to worry less about complexity of their objects. Using a lex file for this behaviour is also a solution, but since the presence flag still has 8 unused bits, personally I don't think it's a necessity. | ||
+ | ::::::--[[User:KHacker35000vr|kHacker35000vr]] ([[User talk:KHacker35000vr|talk]]) 19:57, 3 January 2020 (UTC) |
Revision as of 19:57, 3 January 2020
MDL0 -low
- @Atlas wrote: These objects load the MDL0 from the BRRES files that are tagged with "-low" at the end of their name.
- Can you please explain it for me. What is These objects? Bit set or bit cleared? Have you an example for me?
- Btw, I plan also a section about the *_d.szs files after some more tests.
- -- Wiimm (talk) 21:25, 24 October 2016 (UTC)
- "-lod" is kind of a mistake from me, since it's only used for CPU models (when they're far away, the characters turn into their low-poly, unanimated Level of Detail version, model-lod). The tag "_LOD" is found into TruckWagon.brres, and instead of those models tagged with "-low", this one loads in 1 Player mode too and it does the same as the CPU models, the model is changed to the Level of Detail version when the trucks are far away from the player. —Atlas (talk) 10:01, 25 October 2016 (UTC)
- Yeah, it hasn't. I've tested again, and it seems like -low models are loaded on a track from *_d.szs in splitscreen. In the race intro, the object loads the normal MDL0 instead. So, where is used the -low from the normal course .szs and not the *_d? My guesses are they're used for online 2 players splitscreen. But I can't test that. —Atlas (talk) 19:32, 25 October 2016 (UTC)
LE-CODE Extension: First ideas
I have tested 8124 tracks of my archive and only 1 track has a bit set outside from 0x3f (by accident; I'll update it in the next days). So the usage of bits 6-15 by LE-CODE is not problematic.
The basic idea is:
- Use 2 bits to define a general extension MODE.
- Use the remaining 8 bits as PARAMETERS depending on MODE.
- Allow future extensions.
Here is a first definiton. Discuss it!
Bits | Mask | Description |
---|---|---|
0–5 | 0x003f | Standard bits used by Nintendo. Fallback for non LE-CODE. |
6–7 | 0x00c0 | MODES 0 to 3: Define the meaning of the next block (PARAMETERS). |
8–15 | 0xff00 | PARAMETERS, meaning depends on MODE. |
LE-CODE interprets the presence flags only, if at least one bit of MODE or PARAMETER is set.
Mode | Parameter | Description |
---|---|---|
0 | 0 | Standard settings → LE-CODE does nothing special. |
0 | >0 | Reserved! The idea is, that PARAMETER is an index (1–255) into a LEX table with advanced settings (triggers, counters, conditions, …). |
1 | * | Enable or disable object on combination of race/battle, offline/online, versus/time trial, number of players. For details, see tables below. |
2 | * | Reserved for future extensions! |
3 | * | Reserved for future extensions! |
Mode 1 (Variant A)
Depending on a condition, 1 bit of the PARAMETER is used to decide, if the object is available. LE-CODE will set the presence flags either to 0x00 (disabled) or to 0x3f (enabled) after loading the track.
Bit | Mask | Condition for racing tracks | Condition for battle arenas |
---|---|---|---|
0 | 0x01 | Offline, Versus, 1 human player. | Offline, Ballon Battle, 1, 3 or 4 human players (or 1 player). |
1 | 0x02 | Offline, Versus, 2 human players. | Offline, Ballon Battle, 2 human players (or 2–4 players). |
2 | 0x04 | Offline, Versus, 3 or 4 human players. | Offline, Coin Runners, 1, 3 or 4 human players (or 1 player). |
3 | 0x08 | Offline, Time trial | Offline, Coin Runners, 2 human players (or 2–4 players).. |
4 | 0x10 | Online, Versus, 2–5 players. | Online, Ballon Battle, 2–8 players. |
5 | 0x20 | Online, Versus, 6–8 players. | Online, Ballon Battle, 9–12 players. |
6 | 0x40 | Online, Versus, 9–10 players. | Online, Coin Runners, 2–8 players |
7 | 0x80 | Online, Versus, 11–12 players. | Online, Coin Runners, 9–12 players. |
The number of players is only a proposal. The idea is, that tracks that are tend to be laggy can disable object if more players are active.
For battles we distinguish between Ballon Battle and Coin Runners as well as between few and many players. An alternative for 1,3,4 and 2 players is to distinguish between 1 and 2,3,4 players.
Mode 1 (Variant B)
An alternative for Variant A:
Bit | Mask | Condition for racing tracks | Condition for battle arenas |
---|---|---|---|
0 | 0x01 | Offline, Versus, 1 human player. | Offline, Ballon Battle, 1 player. |
1 | 0x02 | Offline, Versus, 2 human players. | Offline, Ballon Battle, 2–4 human players. |
2 | 0x04 | Offline, Versus, 3 or 4 human players. | Offline, Coin Runners, 1 player. |
3 | 0x08 | Offline, Time trial | Offline, Coin Runners, 2–4 human players. |
4 | 0x10 | Online, Versus, 2–8 players online, single player at Wii. | Online, Ballon Battle, single player at Wii. |
5 | 0x20 | Online, Versus, 2–8 players online, 2 players at Wii. | Online, Ballon Battle, 2 players at Wii. |
6 | 0x40 | Online, Versus, 9–12 players online, single player at Wii. | Online, Coin Runners, single player at Wii. |
7 | 0x80 | Online, Versus, 9–12 players online, 2 players at Wii. | Online, Coin Runners, 2 players at Wii. |
-- Wiimm (talk) 08:15 – 09:45, 2 January 2020 (UTC)
Discussion
Would it be an option to allow loading of -lod MDL0 files depending on the presence flag? I can imagine that in many cases it is not an option to remove an effect, and loading a simplified model could solve that problem.
--kHacker35000vr (talk) 18:59, 2 January 2020 (UTC)
- Is this a decision for every single object? I think, it is more a global setting:
- On CONDITION load simplified models if available.
- -- Wiimm (talk) 20:39, 2 January 2020 (UTC)
- Yes, it's a possible flag for all objects. If set, the low poly model is loaded (if it exists) if it would otherwise not be loaded. Not all objects of a certain type are absolutely necessary for the track to function in some cases after all.
- --kHacker35000vr (talk) 09:07, 3 January 2020 (UTC)
- I think you misunerstood what kHacker said. It's a possible flag for all objects, that doesn't mean it would be a flag just once for the whole track. That suggestion would fit right into the "presence flag" discussion and there should be, as he said, a single bit in the presence flags that forces the game to load the low-poly version. -- Leseratte (talk) 10:34, 3 January 2020 (UTC)
- Again my question and some more:
- Does it make sense to define low-poly-model-loading by a single bit for each GOBJ-element?
- What should a set bit mean? (Why not modifying the brres file?)
- What happen, if a bit is set for one object, but not for a other object of the same type? Then we have 2 different loading statements.
- So my idea is, to define a tuples of kind (object_id,condition) into a lex file. If condition is true, all objects of that type use the low poly model. Another point is, that 1 bit reduces the condition list to half size.
- -- Wiimm (talk) 13:30, 3 January 2020 (UTC)
- Again my question and some more:
- Since most objects have to be visible at all times, most of them can't use any other value than 0x3F to not affect gameplay. Changing the presence flag to also support low-poly model loading will allow for further reduction in CPU/GPU cycles.
- That's indeed a flaw I did not think about when I proposed this idea. However, if I remember correctly, the model to load is stored in memory per object, rather than by object type. It should then be trivial to have different versions of the object loaded at the same time. This is also the advantage this approach has over modifying the brres file.
- It will indeed cost a bit, but in exchange this functionality can be used for more objects and authors will have to worry less about complexity of their objects. Using a lex file for this behaviour is also a solution, but since the presence flag still has 8 unused bits, personally I don't think it's a necessity.
- --kHacker35000vr (talk) 19:57, 3 January 2020 (UTC)