Page 1 of 1

Would it be possible to put unit models in unsynced space?

Posted: 04 Jun 2017, 12:25
by Forboding Angel
Basically so you could have custom unit models/textures for specific people, etc?

Re: Would it be possible to put unit models in unsynced space?

Posted: 04 Jun 2017, 19:28
by sprunk
For models you'd need to hide the real model and draw another one manualy, can't fully replace a model since they also affect synced things (time to aim, weapon emit points...), which also somewhat limits the extend to which you can visually plausibly replace models.

If you want a different synced-model I guess you could create personalized unitDefs (check out old ZK coms) but that introduces extra problems to deal with.

Textures are already fully unsynced AFAIK.

Re: Would it be possible to put unit models in unsynced space?

Posted: 04 Jun 2017, 20:53
by zwzsg
They sorta already are? At least you can, from unsynced space, hide real units model, access unit models, and draw modified or custom unit model, per player.

The things that matter simulation wise such as the shot emit points have to keep using a synced model, but that model doesn't have to be the one that is seen.

Re: Would it be possible to put unit models in unsynced space?

Posted: 04 Jun 2017, 22:05
by Silentwings
Afaics you can already do this with CUS and widget<->unsynced gadget communication. Models themselves cannot really be unsynced, they affect the gamestate, and separating out synced versus unsynced influences of (untextured) models is unnatural - but you can render them however you like using CUS in unsycned gadget.

The unit team colour shading in BAR is an example of how you can render models differently per team, and essentially the same code could work per player.

Re: Would it be possible to put unit models in unsynced space?

Posted: 04 Jun 2017, 23:24
by PicassoCT
A model consists of pieces.. which can carry other units or guns.
So the actually things in need of syncing are these attachpoints and the base- model they move with.
Assuming you had a free configurable unit, where guns could be moved freely on a arm piece by a player- guns would be unsynced.
And the hierarchy can be rearranged in sync.

Re: Would it be possible to put unit models in unsynced space?

Posted: 05 Jun 2017, 04:09
by Forboding Angel
yeah I'm not seeing why the model has to be synced, just the pieces. As long as the script doesn't change and the pieces are the same, I don't see the issue?

Ostensibly, this would be used to have various model replacements. Like players could unlock new cooler models for specific units (like in sc2).

Re: Would it be possible to put unit models in unsynced space?

Posted: 05 Jun 2017, 11:14
by PicassoCT
A unsynced model would consists of a synced baseframe of empty pieces, that would be set by Messages into a configuration. It has not been attempted before.

Re: Would it be possible to put unit models in unsynced space?

Posted: 05 Jun 2017, 12:25
by Kloot
Forboding Angel wrote:not seeing why the model has to be synced, just the pieces
Reminder: the pieces collectively *are* the model, each piece being a chunk of vertices drawn in some relation to its parent with the relation determined by (synced) scripts.

If you want custom visual models, follow the advice of Silentwings and read https://springrts.com/wiki/Lua_UnitRendering / the COS framework code.

Re: Would it be possible to put unit models in unsynced space?

Posted: 05 Jun 2017, 18:43
by zwzsg
Forboding Angel wrote:Ostensibly, this would be used to have various model replacements. Like players could unlock new cooler models for specific units (like in sc2).
In this case, you want synced, since what's the point of unlocking new cooler models if you can't brag by showing them to those who don't have them?