Completed Pioneer Models

This forum area is to share and discuss modding projects, models, music and other modding activities of Pioneer. Please use the 'Alpha Mods' or 'Beta Mods' folders to upload your files in the Pioneer section in the download area.
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Completed Pioneer Models

Post by fluffyfreak »

You can do a ray cast into the scene and see what you hit, but I prefer something a little different.You generate a ray just like we would for a ray cast - project the screen space click into 3d and get the direction from camera pos to that position and normalise it. Then get normalised vectors to each element in the cockpit, find the nearest dot product between the object direction vectors and the click vector. Then test it for some threshold value.This works nicely because if the dot product is 1.0 then it's pointing directly at it, 0.0 and it's pointing at right angles, -1.0 and it's pointing exactly away from it :) Set the threshold at something like 0.9 and it'll always pick something that's within a little cone along the direction you're pointing. If you happen to have multiple things under the mouse that's fine because it will always pick the one that the mouse is closest too visually regardless of depth/distance since everything is a normalised direction.No complicated scene traversal, bounding volume heirarchy tests etc. Just a few dot products, a min test and an if-else. You can probably optimise some of those away too if you're feeling fanatical :lol: First time I saw this in use my hand flung itself to my forehead with a meaty slapping sound! It's so obvious that I immediately looked back at all my old code and cringed :lol:
robn
Private
Posts: 1035
Joined: Mon Jan 31, 2011 10:29 pm

RE: Completed Pioneer Models

Post by robn »

You can go the other way too - run through a list of hot points on the current cockpit model in world space, project them back to the screen and chuck the x,y for each into a list. Then on mouse click, run through that list and match to the appropriate point. This also makes it easier in some ways to integrate with the UI/input layer.There's also precedent - we do this in WorldView for body labels. See UpdateProjectedObjects() and PickBody().
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Completed Pioneer Models

Post by fluffyfreak »

Yes! Also a good idea! Especially if we already have a working example.
Marcel
Private
Posts: 1188
Joined: Tue Dec 06, 2016 6:45 pm

RE: Completed Pioneer Models

Post by Marcel »

3D clickable cockpits? HOLY FRAK! :shock: That would be awesome beyond belief!@ potsmoke66, Thanks! I've got to get to that station, even though it's back there in alpha 15. Pioneer sure is a moving target, isn't it? :lol:I'm glad you said you welcome contributions from people of different skill levels, because I want to share what I've been working on, humble though it may be. It's an upgrade (or possibly a defacement) of Philbywhizz's pad stations. :) [attachment=979:MexicoCity01.jpg][attachment=980:MexicoCity02.jpg][attachment=981:MexicoCity03.jpg]
Marcel
Private
Posts: 1188
Joined: Tue Dec 06, 2016 6:45 pm

RE: Completed Pioneer Models

Post by Marcel »

...and because I can only do 3 attachments per post, here's the actual file. Instructions are included.[attachment=982:spacestations 12.zip]
Marcel
Private
Posts: 1188
Joined: Tue Dec 06, 2016 6:45 pm

RE: Completed Pioneer Models

Post by Marcel »

@potsmoke66, Ok, that worked. Actually what I did was move the models/spacestations.lua over the stations/spacestations.lua that I modified and overwrote it. I suspect the two files are not quite the same because the station had the old crappy green interior that I stuck in there. As for the outside, its absolutely beautiful. It's darker, but not too dark. I know how difficult it is to put textures on those shapes, and you've done a fantastic job. I have a major bit of constructive criticism and some minor bits, however.Major bit: The window textures, while nice, are in the wrong places. This station rotates to provide artificial gravity. Your windows are on the floor and ceiling, and are too big for the scale of the station.Minor bits: I like the illuminated font for the station name, but I think aesthetically it's too large for the place it's on, and besides, there may be stations with longer names that wouldn't fit. The radar dish looks great, but looks off center in that location. I think it would be cool to have two of them on the outer ring at the end of each arm. Oh, and I think the nav lights are flashing a bit too fast. Now, aren't you glad you helped me get there? :lol:In summary, I like it a lot but please fix those windows! :D
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: Completed Pioneer Models

Post by Potsmoke66 »


Quote:
The window textures, while nice, are in the wrong places. This station rotates to provide artificial gravity. Your windows are on the floor and ceiling, and are too big for the scale of the station
i was aware of that, 1st issue is somewhat mipmap bound, if i make smaller windows they vanish completely because of mip-mapping even on highest detail level. that's a problem i (anybody) have with all buildings (compare even my new cylindrical building, the windows have to be sized up, they vanish much to early).2nd, artificial gravity, i know it will be wrong (and you was clever enough to recognize that ;) ). but, i haven't had any good idea to solve that, except a giant texture that will cover the whole wheel from top view, common texture or glow-map.edit: wrong, a mapping only for the inside facing part would be enough (centrifugal force to the outside), but the torus had to be changed into a "lathe" perhaps, further sections of a tube/cylinder never match sections of a torus (one starts on the corner of the division the other on the center of the division)a soulution would be a complete rebuild of the torus[attachment=983:torus_1.jpg]the radar, was planned to be off center (as long that it's rotational axis is centered). well there are some disabled calls for a (updated) building of mine, i disabled to avoid complications and i thought perhaps some wouldn't like that, looks a bit weird).could be now that the nav-lights are really to fast, still i'm not able to run pioneer on the macbook* and the wrapper is far to slow (1-2 fps), i'm simply not able to tell if they are fast or slow (it's guesswork).maybe the green & red pos-lights are better left as they was before. it's more a experimental use here, to show that you can use a sine to control aflashing light. if the frequency is to slow it will show off a quite to long fade-in, fade-out. while on higher freq. it looks better then a immidiate change (rectangular signal), imo.[/hr]*"Error: Vorbis could not open data/sounds/Interface/OK.ogg"somebody's got any idea, do i miss something perhaps?
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: Completed Pioneer Models

Post by UncleBob »


Quote:
but, i haven't had any good idea to solve that, except a giant texture that will cover the whole wheel from top view, common texture or glow-map.
I can't quite follow you there... The wheel is in segments, it is no problem to map those segments to a texture tile (maybe two or three, so it doesn't get too repetitive), but there's no reason to make a whole texture for the entire wheel.
Marcel
Private
Posts: 1188
Joined: Tue Dec 06, 2016 6:45 pm

RE: Completed Pioneer Models

Post by Marcel »

Actually the wheel is a ring in the original (I used two overlapping rings to reduce texture smearing) and it's made of lathes in potsmoke's version. In both cases the wheel is made of big ring-shaped pieces. The original wheel is low-res enough to be remade with segments, but potsmoke's has so many integer steps that it appears perfectly round (with no decrease in performance on my old pc, btw). What about putting a ring or lathe inside the main ring with a glowing material and generic wall texture , and cutout windows in the hull? This might give the illusion of 3D rooms inside the station.Here's a couple of pics for those who haven't seen it.[attachment=984:Gatesp6601.jpg][attachment=985:Gatesp6602.jpg]
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Completed Pioneer Models

Post by fluffyfreak »

All of the spacestations are scripted objects aren't they?As in they're not modelled they're defined only in "spacestations.lua" which creates quads, strips, lathe etc.
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: Completed Pioneer Models

Post by UncleBob »

So basically, the model is defined as a function and the mesh gets procedurally generated in increasing detail...I don't know how neccesary that really is, and one important question would be wheather that mesh is created using CPU or GPU cycles. For an object this big, and considering you'll have only one on the screen at a time, it would IMHO be better to make a mesh with some 10'000 to 15'000 faces. Only few will know the difference. If the current mesh is CPU produced, this will also run FASTER, because handling such a model is doable without trouble by almost any GPU nowadays (except some ancient laptops, maybe).If you really want to stick with procedural mesh generation, You have to do procedural UV mapping too, there's just no way around that.
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Completed Pioneer Models

Post by fluffyfreak »

@UncleBob,That's a long and detailed argument you'll end up having with people. Though for what it's worth I agree.However it's only constructed at startup, I think. I'll try to check now.EDIT - Can't be certain because I don't know what the Lua script is actually doing _but_ it looks like it's only created once.
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: Completed Pioneer Models

Post by UncleBob »


Quote:
EDIT - Can't be certain because I don't know what the Lua script is actually doing _but_ it looks like it's only created once.
I think I confused a few thing. From Marcel's post, I gathered that the mesh is modified while running (similiar to a mipmap) to make it more detailed. After reading you post and re-reading Marcel's post, it seems that I was wrong about that, and that there are instead two versions of the creation algorithm around, with one adding much more tesalation than the other. The model gets created at startup, and doesn't get modified anymore afterwards.In that case, there's absolutely no difference in performance wheather we create the geometry by algorithm or by hand (i.e. modeling software), since the finished mesh is dumped into memory either way. In that case I would strongly advise to make a nice model with a nice texture map.The only reasons there could be for generating a station procedurally is a) making every station look slightly different and b) adding more detail to the mesh as you aproach. Both mean runtime modification, and can be worthwhile if done well, but I really don't see the sense in creating a static mesh by algorithm. Humans usually do that a lot better.
s2odan
Private
Posts: 1212
Joined: Sun Mar 22, 2009 9:50 pm

RE: Completed Pioneer Models

Post by s2odan »


Quote:
but I really don't see the sense in creating a static mesh by algorithm. Humans usually do that a lot better.
AFAIK Tom originally did this as a homage to the old games :)One of their advantages is how simple it is to add extra detail levels or lower detail levels for LOD, you can do this normally too but it requires more work, you'd have to manually make each LOD. But like you said the end result is almost guaranteed to be better using an .obj and nice texture mapping.I suppose its quite easy to create morphing geometry with them too, although that would be far better done on the GPU, and to hell with the collision mesh hehe ;)
Potsmoke66
Private
Posts: 1815
Joined: Sun Nov 27, 2016 2:43 pm

RE: Completed Pioneer Models

Post by Potsmoke66 »


Quote:
I think I confused a few thing. From Marcel's post, I gathered that the mesh is modified while running (similiar to a mipmap) to make it more detailed. After reading you post and re-reading Marcel's post, it seems that I was wrong about that, and that there are instead two versions of the creation algorithm around, with one adding much more tesalation than the other. The model gets created at startup, and doesn't get modified anymore afterwards.In that case, there's absolutely no difference in performance wheather we create the geometry by algorithm or by hand (i.e. modeling software), since the finished mesh is dumped into memory either way. In that case I would strongly advise to make a nice model with a nice texture map.The only reasons there could be for generating a station procedurally is a) making every station look slightly different and b) adding more detail to the mesh as you aproach. Both mean runtime modification, and can be worthwhile if done well, but I really don't see the sense in creating a static mesh by algorithm. Humans usually do that a lot better.
hm...pioneers native scripted geometry will be always better for performance.i can't tell you why, but i have made enough models to compare between (i.e. cty3k exists as sripted geometry as well as made from objects), that i can tell that exactly from experience (and i fear that everything gets turned upside down, just that some rectify themselfes and some theory**).one reason could be that i can only project textures, there is no unfolding and no resulting per face texturing.if you arrange the geometry by texture and projection values, you gain some additional speed, imo.btw, the original "wheel" had fixed divisions, while i used LOD dynamic divisions for all parts of the "big crappy".and if you still don't believe, try to experiment rather to theorize.to me it counts only what FPS i got afterwards, where it may come from i don't mind (...to much, could be interesting to theorize about that, but didn't changes the result).some believe in theory, i believe in facts (results). i'm a construction worker, it doesn't matters what a paper says, but it matters much if it works out and lasts.or to tell in other words, i construct a pipeline without a balance and it's more straight as the one which is been made using a balance. in the end it's measured by the eye and not by a little air bubble.if i stamp decals and emboss them i could calculate the thickness of the material and set the machine up with this value, it never matches. i HAVE to tweak it with the eye (in the best case you can't see where it was embossed if the decal gets peeled off).of course we work here only with virtual things, but still to me the result is what counts.you can use also a texture on lowest lod, but don't be surprised if you get a weak performance....you can run with your head even through a wall, it will hurt i promise.... (i know that from experience too :lol: )[/hr]if people are able to manipulate negatives of x-ray pictures from a uranium pellet, there are willing to manipulate anything, just to rectify something....
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Completed Pioneer Models

Post by fluffyfreak »

@potsmoke66Put bluntly I don't believe that the scripted geometry can get anywhere near the performance of a reasonably textured, single mesh model without any dynamic code.I say this because I've done my best to measure it in other games in the past by using a model that was made of many smaller components vs the same model once it has been welded into a single mesh. That's tricky in Pioneer without having a matching like-for-like model - although I am working on welding the YT-1300 to demonstrate it.The reason is simple; with a single mesh and single texture and no dynamic geometry/texturing the game only needs to do this:1) run static lua script2) set texture3) set mesh4) renderHowever with dynamic or scripted geometry it must do something like this:1) run static lua script2) set texture3) set mesh4) render5) run dynamic script6) begin loops__6a) set dynamic texture__6b) set dynamic geometry__6c) render__6d) goto 6aNot only that but each of those dynamic script calls can create the geometry there and then, i.e; it does the same work over and over again every frame.Also these rendering batches are usually tiny, and by tiny I mean less than 1000 triangles. A lot less!Rendering works BEST when you take a large number of triangles, with a reasonable number of textures and render them all at once.Rendering works WORST when you take a large number of triangle, with a reasonable number of textures and render them all in little bits with constantly changing rendering states for alpha, glow, blending and textures.A lot of our models are closer to the worst state than the best. We don't often see this as a performance problem because we don't render that many of them.A better way of seeing this is to load up the modelviewer with a single mesh/texture ship and run the performance test, then try one with a lot of scripted geometry.None of this is meant as criticism of anyones modelling abilities, it's just that because of the scripted system we seem to have ended up with a lot of ships made of small bits with many separate textures and lots of different rendering states.Andy
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Completed Pioneer Models

Post by fluffyfreak »

Let me go further.I just tested the Wave: 11080 triangles ran at less than 1 fpsThen tested my "thor"*: 52622 triangles at 10 or 11 fpsAlmost 5 times the triangles, but runs more than 10 times faster.NB: *"thor" is an abandoned model from the Infinity Universe archive that I use for testing because the original model has more vertices than our 16bit indices supports - used without permission which I why I don't release it. It has a single 1024x1024 texture applied and no dynamic lua function.
robn
Private
Posts: 1035
Joined: Mon Jan 31, 2011 10:29 pm

RE: Completed Pioneer Models

Post by robn »


fluffyfreak wrote:
None of this is meant as criticism of anyones modelling abilities, it's just that because of the scripted system we seem to have ended up with a lot of ships made of small bits with many separate textures and lots of different rendering states.
Thanks for articulating some of the detail. All the reasons you mention are why we're trying to move away from dynamic sections.hat iRight now the best case is when dynamic only does submodel selection for equipment etc. A good next step is probably arranging for static hardpoints to be declared and let the renderer decided when to render a missile or whatever.Following that if we can get declared animations of some sort in, then it shouldn't be necessary to have a dynamic section at all.
UncleBob
Private
Posts: 185
Joined: Wed Aug 26, 2009 3:18 am

RE: Completed Pioneer Models

Post by UncleBob »


Quote:
Following that if we can get declared animations of some sort in, then it shouldn't be necessary to have a dynamic section at all.
Not to mention the fact that it'll be much easier to model, at least if you manage to support a popular format... :D
Quote:
some believe in theory, i believe in facts (results).
Me too, actually. And when it comes to a game, there's always two facts to consider: one is FPS, and the other is awesome, and your goal is to get the most awsome per frame. Which is a thing static, well designed meshes are usually best at.
TonySpike
Private
Posts: 68
Joined: Thu Sep 23, 2010 9:50 pm

RE: Completed Pioneer Models

Post by TonySpike »


"Marcel wrote:
@spike1984, Have you flown to Gates spaceport? If you have, I may have installed this wrong, and should erase it and start over.I'm going to put this aside for now 'cause I want to get back to upgrading Philbywhizz's pad station. (almost done!)
sorry for the late reply mate i been busy lol ........eeer no not yet .....but i will give it a go for ya lolEDIT ...just noticed ..you probly fixed the issue lol ...sorry
Post Reply

Return to “Pioneer Mods”