Page 1 of 1

Simple model request- sphere

Posted: Wed Oct 24, 2018 4:13 am
by JackGriffin
Can someone make me a simple sphere primitive please? It's not possible in UEd :( If I can specify can you make it with 150-180 faces, 2 sided and normals facing inwards please? This is probably 60 seconds work if you know what you are doing. I don't (obviously).

When I first started mocking up the collapsing zone gametype I needed a sphere to use and couldn't find one. I ended up using the mesh from the redeemer shockwave and it was fine. However as I was tightening the code up the other day my math kept being off and I couldn't figure out why. Eventually I looked at the shockwave mesh and it's not a true sphere, it's actually somewhat oblong. That's why my math kept being slightly off. I really need to fix this.

Thanks if you can do this!

Re: Simple model request- sphere

Posted: Wed Oct 24, 2018 9:35 am
by Krull0r
I can do it for you :)

Re: Simple model request- sphere

Posted: Wed Oct 24, 2018 1:44 pm
by Feralidragon
The main issue is always the number of polys, as the less polys you have, the less curvy the sphere is, and the less accurate will that kind of calculation be relative to the real model shape.

I don't think only 200 polys will cut it, especially given the size that you want which is pretty big.
Since it's a single model, I would instead advise to make it at least 1000 polys, as the engine can handle some 1k models in view just fine.

Spheres have a bit more science to them than what they look at first, especially when your next worry is UV mapping: some ways of building spheres are more UV mapping friendly than others.
The ultimate one is making a sphere out of a tessellated cube (this is what games like No Man's Sky do to generate planets).

For whoever's interested: https://medium.com/game-dev-daily/four- ... 956b825db4

Re: Simple model request- sphere

Posted: Wed Oct 24, 2018 2:02 pm
by JackGriffin
You know as I was looking at the editor spheres and seeing what happens as I increased the face count it occurred to me that the mean distance was changing but I chalked it up to "being so small it didn't matter". Now that I find errors in the math I can see I was pretty wrong, especially with the very large drawscale I'm working on. Reading your reference now I know why. Thanks for that.

Krullor is making it as we speak, and is using your suggestion of vastly increased face count.

Re: Simple model request- sphere

Posted: Wed Oct 24, 2018 5:46 pm
by Higor
Try this:
(importer) https://github.com/CacoFFF/SiegeIV-UT99 ... hieldHQ.uc
(models) https://github.com/CacoFFF/SiegeIV-UT99 ... ter/Models

And this is what it looks like:
Minishield.png
The model has surfaces facing both ways, the inner surfaces are modulated, the outer ones are normal/translucent and two-sided.
And both inner and outer use different textures.

EDIT:
Forgot to say, the minishield actor has a CollisionRadius/CollisionHeight of 50, and a fully spheric hitbox (see: AdjustHitLocation)
https://github.com/CacoFFF/SiegeIV-UT99 ... iShield.uc
So it's safe to assume I made the sphere with a radius of 50 as well.

Re: Simple model request- sphere

Posted: Thu Oct 25, 2018 1:57 am
by JackGriffin
I had thought of this but I knew the Siege community endured it's share of copying and theft and so I didn't think it was wise to ask. It would be super obvious where it came from, even reskinned.

That being said I'm *super* grateful for you letting me use this. It's exactly what I needed and then some. Thank you very much. Yay community!!

Edit: OMG that looks so sexy in UnrealFX....
2nd (and last) Edit: Imported this into my game and it works perfectly. I had to redo my math to match the different base mesh size but as soon as I did the threshold was spot on. NOW it's right (and I can go to bed lol).