Problem has been solved! Thank you! More questions further down though.solved questions wrote:Working on a small project. Made a model and texture, put them into Balanced Annihilation (for the sake of having a working framework to test with) by replacing the Arm Flash.
So I have "armflash.s3o" in the objects3d folder, changed the object name in armflash.lua from "armflash" to "armflash.s3o". Then I copied the two textures "prototype3_1x.dds" and "prototype_2x.dds" to the unittextures directory. I assigned these textures in UpSpring, and they appear properly in that program. Also, I named my unit's object to be "base" in upspring to ensure that it at least appears.
The unit loads in the game and if I put my mouse cursor over it I can see a halo that shows the unit's proper working model (mine, not the original Flash). It seems everything is fine except there's no texture.
I'm doing this as a proof of concept before working on anything else, but I'm stuck at this point. I realize the unit should not function properly without a script, but I just want the unit itself to appear as a starting point. And it does, but no textures show.
Does anyone know what I'm doing wrong?
One note, I'm using 2048x2048 as my texture size... I don't see why this would be a problem but I thought I should say. Also, if it helps to diagnose the problem, I only seem to be able to select the unit by either dragging a box around where it should be, or zooming in close and hovering over a very small area with my mouse.
I've attached a picture demonstrating the problem.
Unit is invisible (no textures showing)
Moderator: Moderators
Unit is invisible (no textures showing)
Last edited by nawoa on 13 May 2011, 18:29, edited 4 times in total.
Re: Unit is invisible (no textures showing)
Did you set radius and height of the s3o?
Does your texture 2 have an alpha channel? Texture 2 alpha is 2-bit transparency.
Does your texture 2 have an alpha channel? Texture 2 alpha is 2-bit transparency.
Re: Unit is invisible (no textures showing)
THE UNIT IS CLOAKED!
Re: Unit is invisible (no textures showing)
jK wrote:THE UNIT IS CLOAKED!
Seems like xray shader to me.The unit loads in the game and if I put my mouse cursor over it I can see a halo that shows the unit's proper working model
The alpha channel of texture to should be completely white.
Re: Unit is invisible (no textures showing)
Maybe try reducing the size of your texture to 512 and see if it appears.
Re: Unit is invisible (no textures showing)
(minor but important spelling correction)
Wait for someone who know what they are talking about to confirm as I haven't modeled an s3o for years but:
This is my bet. If I recall correctly Alpha channel of texture two determines transparency (alpha of texture 1 determines team-color mix)... so you likely have an all black alpha layer (or no alpha layer... seem to recall this is the same thing) in texture two.
+1Beherith wrote:The alpha channel of texture TWO should be completely white.
Wait for someone who know what they are talking about to confirm as I haven't modeled an s3o for years but:
This is my bet. If I recall correctly Alpha channel of texture two determines transparency (alpha of texture 1 determines team-color mix)... so you likely have an all black alpha layer (or no alpha layer... seem to recall this is the same thing) in texture two.
Re: Unit is invisible (no textures showing)
It's like people can't even read my posts. ![Cool 8)](./images/smilies/icon_cool.gif)
![Cool 8)](./images/smilies/icon_cool.gif)
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Unit is invisible (no textures showing)
This is why. I've done it myself many times.FLOZi wrote:Did you set radius and height of the s3o?
Does your texture 2 have an alpha channel? Texture 2 alpha is 2-bit transparency.
Re: Unit is invisible (no textures showing)
All questions answered.solved questions wrote:It seems that the issue was that the model did not have a center x/y/z, radius, or height set in UpSpring. If I'm correct, one gridline equals 5 units...?
Thank you for the help so far, I have a fresh set of questions!
It's been a struggle even getting to this point; the wiki has a lot of outdated information. I don't want to trust it as a source. Can someone knowledgeable tell me if this is correct:
1) Textures 1 and 2 can be named anything, as long as the names are specified in the s3o using UpSpring. Textures should be named simply as "texture1.dds" for example, not "unittextures/texture1.dds".
2) Texture 1's alpha channel areas will show as team color. The texture should be located in the unittextures directory in the mod hierarchy in DDS-DXT3 format.
3) Texture 2's red areas are self-illumination, green areas are reflectivity, and alpha channel is transparency.
Assuming all of the above is correct, what is Texture 2's blue channel for, anything?
It appears that unit script files are in BOS and COB format; I read elsewhere that lua was used. Can the BOS file be simply renamed lua and still function or must it be rewritten? Is there an example lua file somewhere which demonstrates how functions are to be written?
Does Spring have an SDK of any kind - small demonstration dataset which gives a couple of working examples using the most up-to-date specifications?
Is it possible to use more than one set of textures for a single unit? For example, have a 256x256 texture for one section and a 512x512 texture for another? If not by default, can this be accomplished using some sort of unit-combining trick, etc?
Do textures need to be of arbitrary sizes or aspect ratios? Can texture1 and texture2 be different sizes, for example 512x512 and 256x256?
Finally, during my now-successful testing, I found that units have a tendency to jitter and sort of fight to occupy the same area while moving in a group. I tried with my "new" unit (armflash), its companion (corgator) and a large unit (corgol) to ensure this was not an issue with my model being too big or something of that nature. All three units had the same issue.
I remember playing a game which used the Spring engine years ago and I didn't experience this issue at the time. Is this an engine problem or a result of a problem in Balanced Annihilation? In either case, can someone describe a simple workaround so I can complete my testing?
If the problem is pathfinding, what is used to determine paths, the size of the unit as defined in UpSpring or the size of the unit's footprint as defined in its descriptor file? Is it the same as the unit's weapon collision sphere as I see with alt-b? Can the collision sphere be replaced with another type of object for the purpose of weapon impacts, such as a cube, or can the sphere be deformed in any way? Perhaps separate hitbox objects in the model file?
Last edited by nawoa on 13 May 2011, 18:28, edited 3 times in total.
Re: Unit is invisible (no textures showing)
There is this thing:nawoa wrote:Does Spring have an SDK of any kind - small demonstration dataset which gives a couple of working examples using the most up-to-date specifications?
Tutorial Game for new modders
Topic: http://springrts.com/phpbb/viewtopic.php?f=14&t=25831
Website: http://code.google.com/p/springtutorialgame/
Re: Unit is invisible (no textures showing)
ANSWEREDsolved questions wrote:Thanks, it looks like exactly the sort of thing I need.
One new question: Since UpSpring is given the model's center Y position, why does it also need to know the model height? Isn't it naturally going to be 2x the center Y position? This makes me think it must be used for something else... does anyone know what?
Does the engine have any sort of LoD system?
Where are the game settings kept, in a file somewhere or the windows registry? If it's the registry, can this be done with a file instead somehow?
Last edited by nawoa on 13 May 2011, 18:55, edited 8 times in total.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Unit is invisible (no textures showing)
Yes, the unit must always have a height. A lot of gadgets will also attempt to get unit height for this or that, so it pays to set it correctly.
Height is used for healthbar position for example.
LOD's are generated. There are big fights that break out over what format to use for unit textures. DDS is not as nice looking (though on a large scale the difference may not be noticeable at all) or as easy to work with as PNG but it will allow you to define your own mips, etc if you prefer that level of control (if you need help with your textures from other community members, png is prolly the better format, as many of us detest working with dds).
You can not have multiple textures for texture1, no, however, it is possible to use one texture for many units. For example, in Evolution RTS we use what we call "legos", which is a giant set of pre-fabricated parts that we put together to make units. They are available to download and what you can make with them pretty much the sky is the limit. They are already uvmapped and there is a very nice texture for them you can use (or make your own).
More info here: http://springrts.com/phpbb/viewtopic.php?f=9&t=22283
Height is used for healthbar position for example.
LOD's are generated. There are big fights that break out over what format to use for unit textures. DDS is not as nice looking (though on a large scale the difference may not be noticeable at all) or as easy to work with as PNG but it will allow you to define your own mips, etc if you prefer that level of control (if you need help with your textures from other community members, png is prolly the better format, as many of us detest working with dds).
You can not have multiple textures for texture1, no, however, it is possible to use one texture for many units. For example, in Evolution RTS we use what we call "legos", which is a giant set of pre-fabricated parts that we put together to make units. They are available to download and what you can make with them pretty much the sky is the limit. They are already uvmapped and there is a very nice texture for them you can use (or make your own).
More info here: http://springrts.com/phpbb/viewtopic.php?f=9&t=22283
Re: Unit is invisible (no textures showing)
Radius is the important one iirc, but the others should be set too.nawoa wrote:It seems that the issue was that the model did not have a center x/y/z, radius, or height set in UpSpring. If I'm correct, one gridline equals 5 units...?
Sad but true. Some of us are trying to clean it up but it's a long process.Thank you for the help so far, I have a fresh set of questions!
It's been a struggle even getting to this point; the wiki has a lot of outdated information. I don't want to trust it as a source. Can someone knowledgeable tell me if this is correct:
This is correct.1) Textures 1 and 2 can be named anything, as long as the names are specified in the s3o using UpSpring. Textures should be named simply as "texture1.dds" for example, not "unittextures/texture1.dds".
This is correct. Format is a matter of choice, but dds does have significant bonuses to offset the difficulty of working with it. (dxt3 or dxt5 is a choice I'm not too familiar with the details of)2) Texture 1's alpha channel areas will show as team color. The texture should be located in the unittextures directory in the mod hierarchy in DDS-DXT3 format.
All correct.3) Texture 2's red areas are self-illumination, green areas are reflectivity, and alpha channel is transparency.
Generally nothing. Some mods used to include their own shaders to separate reflectivity into reflectivity (green) and specular (blue) but I'm not sure if any still do this and if it would even work anymore.Assuming all of the above is correct, what is Texture 2's blue channel for, anything?
BOS is a completely different format to lua so it can't just be renamed. The first two links in further reading here: http://springrts.com/wiki/Animation-LuaScripting are a Lua Unit Script (LUS) tutorial.It appears that unit script files are in BOS and COB format; I read elsewhere that lua was used. Can the BOS file be simply renamed lua and still function or must it be rewritten? Is there an example lua file somewhere which demonstrates how functions are to be written?
Generally speaking no. You can (theoreticallyIs it possible to use more than one set of textures for a single unit? For example, have a 256x256 texture for one section and a 512x512 texture for another? If not by default, can this be accomplished using some sort of unit-combining trick, etc?
![Cool 8)](./images/smilies/icon_cool.gif)
The dimensions should probably be power-of-two, otherwise anything goes.Do textures need to be of arbitrary sizes or aspect ratios? Can texture1 and texture2 be different sizes, for example 512x512 and 256x256?
Welcome to Spring. There are some widgets which attempts to mollify 'jitteryness'. You can also experiment with the heatmapping tags in the movedefs. Generally speaking it is the footprint size set in the movedef (not the unitdef!) which determines pathing, unitdef footprints should be set to match these.Finally, during my now-successful testing, I found that units have a tendency to jitter and sort of fight to occupy the same area while moving in a group. I tried with my "new" unit (armflash), its companion (corgator) and a large unit (corgol) to ensure this was not an issue with my model being too big or something of that nature. All three units had the same issue.
I remember playing a game which used the Spring engine years ago and I didn't experience this issue at the time. Is this an engine problem or a result of a problem in Balanced Annihilation? In either case, can someone describe a simple workaround so I can complete my testing?
If the problem is pathfinding, what is used to determine paths, the size of the unit as defined in UpSpring or the size of the unit's footprint as defined in its descriptor file? Is it the same as the unit's weapon collision sphere as I see with alt-b? Can the collision sphere be replaced with another type of object for the purpose of weapon impacts, such as a cube, or can the sphere be deformed in any way? Perhaps separate hitbox objects in the model file?
Ellipsoids, cylinders and boxes can be used, see http://springrts.com/wiki/Unit_collision_volumes . No model-object based hitbox objects currently.
Re: Unit is invisible (no textures showing)
ANSWEREDanswered questions wrote:Thanks for the link to the scripting wiki page, I think it will be very helpful. It looks like the example mod has some Lua scripting examples as well, I will examine them carefully.
To clarify, please tell me if I'm getting this 100% right:
1) the "hitbox" is used ONLY for weapon collisions, not for any other purpose whatsoever (definitely not pathfinding) EXCEPT for aircraft.
2) the "hitbox" is defined BY DEFAULT in UpSpring, but it can be overridden by parameters in the in the unit definition file.
How does this work in the case of aircraft? The wiki pages says the hitspheres are scaled down, is this the case for pathfinding as well as weapon collisions? Do aircraft use spheres exclusively for hit detection and/or pathfinding or can other shapes work without issue?
I notice that there's a type of "hitbox" called "CylY", which seems to imply that there are CylX, CylZ as well, is this the case?
Also, I do know a Spring-based game which didn't have the jittery issue, at least not so severely. This was years ago though, it may be possible the problem is due to engine changes in the meantime. Or maybe my mind is playing tricks on me. I'm going to work under the assumption that it's so bad in BA due to gameplay considerations of some kind which I may be able to avoid.
Wiki also mentions you can have multiple hitboxes, but only goes so far as to say that it's possible and then literally devolves into "blabla"... Can you clarify?
Finally, one of my earlier questions wasn't answered and it's pretty important to my use. Where are Spring settings stored?
Thanks for all the help so far!
Last edited by nawoa on 13 May 2011, 18:38, edited 1 time in total.
- SanadaUjiosan
- Conflict Terra Developer
- Posts: 907
- Joined: 21 Jan 2010, 06:21
Re: Unit is invisible (no textures showing)
I don't think its a great idea to cross out your previous posts... future people with problems often look on the forums for help, and while they can still read them it just makes it a little tougher.
Just a suggestion.
Just a suggestion.
Re: Unit is invisible (no textures showing)
hi
the "example mod" (spring tutorial game) and the hitbox wiki page are both by me...![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
So if there is unclear stuff or "...blabla" , it is because I did not know better and appearently nobody* else does either.
I was wondering about the Y myself but somehow thought "CylY" was just a strange short form of "cylinder"
Actually it defines the rotation of the cylinder shaped hitbox, ie CylZ:
![Image](http://h-7.abload.de/img/cylzhitboxknbz.png)
so yes, CylX, CylZ exist. Just nobody* knows about it.
But typing /airmesh into chat shows some grid thing that aircrafts use to decide their flight height.
I think jittering during moving of units is partly the engine's pathfinding and partly the games.
Of course it is also everybody faults that nobody* knows what would be good settings in the unit files.
*documentation is fail. most of it is based on the trial & error by people who should be reading the wiki, not writing it.
the "example mod" (spring tutorial game) and the hitbox wiki page are both by me...
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
So if there is unclear stuff or "...blabla" , it is because I did not know better and appearently nobody* else does either.
mind = blown. I actually did not think about that but you are right.I notice that there's a type of "hitbox" called "CylY", which seems to imply that there are CylX, CylZ as well, is this the case?
I was wondering about the Y myself but somehow thought "CylY" was just a strange short form of "cylinder"
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Actually it defines the rotation of the cylinder shaped hitbox, ie CylZ:
![Image](http://h-7.abload.de/img/cylzhitboxknbz.png)
so yes, CylX, CylZ exist. Just nobody* knows about it.
yes. And as the wiki says, you can even change the hitbox with scripts during gameplay. ie if a unit unfolds/grows the hitbox can change to reflect that.2) the "hitbox" is defined BY DEFAULT in UpSpring, but it can be overridden by parameters in the in the unit definition file.
the unit radius is also used to decide if a mouse click was on a unit (i think)1) the "hitbox" is used ONLY for weapon collisions, not for any other purpose whatsoever
yes.(definitely not pathfinding)
Afaik aircraft do not use hitboxes for pathing either. They just bump into each other like ground units do too, which can change their course. Aircraft do not seem to "path" around obstacles/units at all.EXCEPT for aircraft.
But typing /airmesh into chat shows some grid thing that aircrafts use to decide their flight height.
I think jittering during moving of units is partly the engine's pathfinding and partly the games.
Of course it is also everybody faults that nobody* knows what would be good settings in the unit files.
*documentation is fail. most of it is based on the trial & error by people who should be reading the wiki, not writing it.
Re: Unit is invisible (no textures showing)
Terrific, thanks for the answers. Sounds like I'll have some experimentation to do after all, but that's to be expected. I have a few questions left:
The wiki says you can have multiple hitboxes, and Knorke might've answered this or maybe not, I'm not sure. Is this to mean only that the hitboxes can be changed during gameplay, or that a unit can have multiple hitboxes simultaneously, like a sphere, a cube, and two cylinders all at once to fully outline a unit's model?
Next, where are Spring's settings stored?
My next questions are about some different ideas I have for making this project scale well on different hardware:
Is there an up-to-date list of console commands available, eg, for setting LOD distance, icon distance, etc, while the game is already running?
Does the engine render hidden objects in any manner? Example, if I had a 1,000,000 triangle sphere or something somewhere on a unit but it was hidden by default, would it impact CPU or GPU performance if it was hidden? What if it was unhidden, then hidden again? I would try this myself but I have only high-end and extreme low-end computers available to me at the moment and any testing I do would probably be heavily skewed, not very helpful. I'm concerned about both the CPU and GPU impact though.
edit: there's a lot of conflicting information, is there an up-to-date list of what Lua unit definition tags are read by the engine, preferably with any eccentricities explained? Default values as well would be very nice.
The wiki says you can have multiple hitboxes, and Knorke might've answered this or maybe not, I'm not sure. Is this to mean only that the hitboxes can be changed during gameplay, or that a unit can have multiple hitboxes simultaneously, like a sphere, a cube, and two cylinders all at once to fully outline a unit's model?
Next, where are Spring's settings stored?
My next questions are about some different ideas I have for making this project scale well on different hardware:
Is there an up-to-date list of console commands available, eg, for setting LOD distance, icon distance, etc, while the game is already running?
Does the engine render hidden objects in any manner? Example, if I had a 1,000,000 triangle sphere or something somewhere on a unit but it was hidden by default, would it impact CPU or GPU performance if it was hidden? What if it was unhidden, then hidden again? I would try this myself but I have only high-end and extreme low-end computers available to me at the moment and any testing I do would probably be heavily skewed, not very helpful. I'm concerned about both the CPU and GPU impact though.
edit: there's a lot of conflicting information, is there an up-to-date list of what Lua unit definition tags are read by the engine, preferably with any eccentricities explained? Default values as well would be very nice.
Last edited by nawoa on 13 May 2011, 19:29, edited 3 times in total.
Re: Unit is invisible (no textures showing)
A unit can have per-piece collision volumes (which will rotate and move with the pieces), using thenawoa wrote:The wiki says you can have multiple hitboxes, and Knorke might've answered this or maybe not, I'm not sure. Is this to mean only that the hitboxes can be changed during gameplay, or that a unit can have multiple hitboxes simultaneously, like a sphere, a cube, and two cylinders all at once to fully outline a unit's model?
Code: Select all
usepiececollisionvolumes = true,
AFAIK the only game currently using this is S44, which simply uses the automatic box-volumes generated when the tag is turned on for the hull and turret pieces and disables all others. The (very simple) gadget which does this is here.
springsettings.cfg, either in the Spring dir itself or in the data dir (the dir in user land where game/map packages are stored).Next, where are Spring's settings stored?
I'll let an engine dev answer the last two questions, though I suspect the answer to the last one is no.
Go to the sourcethere's a lot of conflicting information, is there an up-to-date list of what Lua unit definition tags are read by the engine?
![Wink ;)](./images/smilies/icon_wink.gif)
https://github.com/spring/spring/blob/m ... nitDef.cpp
Re: Unit is invisible (no textures showing)
console commands:
http://springrts.com/wiki/UI_commands
obviously incomplete and fail.
http://answers.springlobby.info/questio ... est-my-mod
the console commands usefull for game testing
icon distance has a command (don't know right it), maybe on wiki.
or try typing /icon <press tab> and see if it autocomplets to something.
render efficiency:
no idea. Ages ago somebody did tests to show that polycount is not that important and it is an often repeated mantra. Lots of pieces can cause slowdowns because the engine must calculate all their move/rotation matrix (at least i think/heard thats why, i dont know) even if the pieces are hidden.
I made some units with 30-100 piece count and while I noticed some lost fps on my 7 year old computer, everything remained totally playable even with many units.
![Image](http://h-5.abload.de/img/ingametrackanimiation2amcv.gif)
ie each track element on this unit is one piece.
I chose haha_oh_wow.jpg
http://springrts.com/wiki/UI_commands
obviously incomplete and fail.
http://answers.springlobby.info/questio ... est-my-mod
the console commands usefull for game testing
for terrain LOD: pos1/end keys.for setting LOD distance, icon distance
icon distance has a command (don't know right it), maybe on wiki.
or try typing /icon <press tab> and see if it autocomplets to something.
render efficiency:
no idea. Ages ago somebody did tests to show that polycount is not that important and it is an often repeated mantra. Lots of pieces can cause slowdowns because the engine must calculate all their move/rotation matrix (at least i think/heard thats why, i dont know) even if the pieces are hidden.
I made some units with 30-100 piece count and while I noticed some lost fps on my 7 year old computer, everything remained totally playable even with many units.
![Image](http://h-5.abload.de/img/ingametrackanimiation2amcv.gif)
ie each track element on this unit is one piece.
yes, possible. Ask Flozi how it is done, he uses it in the S44 game for the tanks. You can even detect which volume got it (like wheels, turret etc)a unit can have multiple hitboxes simultaneously, like a sphere, a cube, and two cylinders all at once to fully outline a unit's model
Can I use an image macro for this? please? pleease?is there an up-to-date list of what Lua unit definition tags are read by the engine, preferably with any eccentricities explained? Default values as well would be very nice.
I chose haha_oh_wow.jpg