Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

1875 Excellent

About Stainless

  • Rank

Personal Information

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. If you are focused on graphics programming, then I would suggest you try a different approach first.   It will take you a long time to learn enough to have a graphics framework you can experiment in if you write everything yourself.   I would suggest you start by looking at online sites that let you play without having to re-invent the wheel.   For example spend some time looking at shadertoy. Look at some of the simpler shaders until you think you understand them. Then change them and see if you are right. You can change the code in the browser and instantly see the effect your changes have had.   Once you are comfortable doing that, then you can start looking at what to do next.
  2. Stainless

    Custom Gui Questions

    Some notes for you to think on,   Button presses.        Don't trigger your events on left button down. Trigger them when the state goes from down to up. The reason behind this is simple. Assume your game is running at 60hz. The average player presses the left button for about 200mS. So if all you trigger on is the left button being down, you could potentially send 10 - 15 button press events when you only want one.   Text rendering.       The best way I have found of handling text is signed distance field fonts. You can get away with a lot less font's in memory as they allow you to scale up with great accuracy. I personally don't like scaling fonts down, I can see artifacts when I do that, but scaling up is great and saves a lot of memory, time, etc.        Yes it will take you a bit longer to get text rendering, but it is worth it in the long run.   Complex gui items.        There are no complex gui items. What you are thinking of is actually a collection of simple gui items. Make sure your base design allows for this and you will be fine.
  3. Stainless

    Line Creation Techniques

    Generating 3D geometry from the spline is trivial, I already have code for that.   I really don't want to go down the route of generating road sections on a per grid basis. It's simple, and works, but looks rubbish. I just set a bit in a byte for each sector adjacent to the current one. This gives me an index into an array of prefabs I can just drop onto the world.   It just looks like exactly what it is. A 1990's solution.   Graph theory is a good idea, I'll do some reading in that area and see if anything pops,
  4. Stainless

    Line Creation Techniques

    After the first pass of my code I have some 600 "lines"   These lines are actually a list of points which are connected and therefore can be classed as part of the line.   This is the same thing as vanilla potrace does.   After that I want to convert this list of points into a set of splines or straight line segments that pass through the centre of these points.   The reason is I want to use the data not just for map drawing. I also want the same data to be used to generate geometry in the in the 3D engine.   If I use the output above, I end up with all my roads and railways being one pixel wide, which in game terms is 200 M   I don't know many roads 200M wide, and certainly none in 1940. :)   The solution is going to be selecting parts of the point list and converting them into splines.   However trying to convert the whole point list into a single spline won't work.   So it's some technique for working out which parts of the point list can be converted into a spline I am looking for.
  5. I am writing a flight simulation game, and as you all know, this is a massive task for a single person to take on.   So I have had to make some hard decisions to make. One of them was the terrain system.   It would have been nice to have an open world , whole planet, terrain system, but with one coder that would have killed the project. So I have decided to use maps from a modding community (with their permission of course).   The maps have a fairly simple format. One bitmap defines the terrain heights. Another the terrain type and other files contain locations and objects.   The types map uses 5 bits for the actual terrain type, and index into a texture array basically. The other three bits are HasMajorRoad, HasMinorRoad, and HasRailway.   These are the bits I need some help with.   I don't want to do a Lego style system for the roads. Basically you look at all the cells around the current one to create an index into an array and drop in the road section that matches. This would mean all roads exit a terrain cell at the same points and would make everything very unnatural.   So I scanned the bitmap and extracted all the cells with roads, collecting them into point lists. I then used a modified version of the Potrace algorithm to convert the point lists into line lists.     At first glance that seemed to work.   [attachment=32808:roads_1.png]   It is only when I zoomed in I realized I had a problem.   [attachment=32809:roads_3.png]   It seems the Potrace algo actually traces around the point list rather than along the point list.   It's even worse when I add minor roads and rail ways   [attachment=32810:roads_4.png]   Has anyone seen any good ways or converting a point list into a line list?   I don't have time to re-invent the wheel.   Cheers guys.  
  6. Stainless

    External Level Editor?

    Whenever you get to this stage in an engine, you have to make a choice from the two most basic approaches.   1) Write your own editor.                                               [ Unity, Unreal, etc    ] 2) Write an export script for an existing editor.              [ Most game studios ]   It really just comes down to that choice.   Most designers like an interface they know, so writing an export script for Maya / Blender / Zbuffer  is the approach they will usually force down your throat. This isn't always the best approach though and can require a lot of programming effort. You also have to maintain it. A simple update of the tool can break everything and stop development in it's tracks until you fix it.   Writing your own has a lot of advantages. It's your own renderer so things look the same in the editor and in game. All the file types are the ones you want to use. It's infinitely expandable and can grow as you need it to. (Some call that a good thing, others call it feature creep and swear at you)   Getting your own editor started is a lot of work though.
  7. Stainless

    Obj file loading weird problem

    Check your UV coordinate settings.   I have found many OBJ files with UV coordinates less than zero and greater than one.   If you are clamping your texture coords, then anything less than 0 will be 0 and anything greater than 1 will be 1.
  8. Stainless

    Procedural star shader

    By stars, what do you mean?   If you mean the star in the local star system. then you should look at things like this   If you mean background stars, that's a whole different subject.   Start with a nice sky dome and then think about adding some of the nearest stars as animated sprites.
  9. Stainless

    Axis orientation

    Just to make things even more fun, often you find conventions apply to particular fields.   Like in aerodynamics they have a convention which nearly all applications stick to.    This may not be the same as the physics system in your game, which itself may be different to the one used in the renderer.   It can end up causing you to melt into a quivering wreck in the corner of the office. Whimpering quietly while forming coordinate sets with both hands and trying to rotate one to match the other like an apprentice magic user trying to complete a difficult spell.   You just have to look at any third party software you are using and work it out carefully.
  10. Stainless

    Problems with "stickiness"

    Hi Aken,   Can't do that in this physics engine I'm afraid, nice idea though.   I'm starting to think I have no choice but to have a special case for these objects. Nothing I have tried works.   Cheers   Paul
  11. Stainless

    Mesh format?

    There are four times as many mesh formats as there are graphics coders in the world. (may be even more :( )   Every time you write code to display a mesh you have different requirements than the last time you did it, so you end up with a different format.   The key is to use a base format that works with your tool chain, and then write a converter. This can either be a stand alone program, or more commonly a plugin for whatever 3D editor you are using.
  12. Stainless

    Diagnosing problems in shaders

    You can try using pixwin, but be careful with it.   It is very good at meshes and transforms, but it emulates the GPU so shaders that run correctly in pixwin may not run correctly in real life.
  13. Stainless

    Problems with "stickiness"

    I get the overlap area out of the physics system anyway. Glancing at the code it seems to be using planar equations to calculate the value.   We have separate collision meshes from the visible mesh, but if we reduce the poly count of the collision mesh to a point that the objects stick together, then they don't behave properly in the general case. Throw one onto a flat plane and the don't do a weeble impersonation (weebles wobble but they don't fall down) they just jerk around until they settle on a face of the collision mesh. Usually at a very unnatural angle.   I thought about having two collision meshes and switching between them depending on the game state, but that's not practical in our engine.   Thanks for the ideas though.
  14. Stainless

    Problems with "stickiness"

    In the game I am working on you can have objects that are sticky.   I have modeled this by catching collision events and processing them.   The strength of the bond is proportional to the overlap area of the two objects and this works very well indeed for objects with planar faces.   However for spherical or curved objects, not so much.   Thinking about it in the general case, if you were to place a sphere on top of a cube. The overlap area would be infinitely small.   Indeed when  I look at the numbers coming out of my physics system, the overlap area is very small indeed. This is an artifact of the mesh being high poly. I want to keep the poly count high on these objects as they just look awful with a low poly count.   I am looking for inspiration.   I really want to avoid having a special case for curved objects. It creates all kinds of problems for things like hemispheres and introduces extra processing in a part of the code I need to keep speedy.   Any ideas guys?  
  15. Stainless

    Game Object Update Order

    Dependency order on components within objects is really, really important and should be done on a per object basis.   Consider the case where you have an object that is made up of a skinned mesh, animated by a morpheme network, with sound emitters, physics, impact effects, and a child object.   If you get the update order wrong then you can get loads of horrible effects. Mesh parts disappearing through walls, bullets that miss even though they pass through the visible mesh, effects that float around near the object instead of on it.   The way we deal with this is we have created a dependency helper class. It has methods on it like After(component) and Before(component).   In the object creation tool we allow you to connect up components, so an object may or may not have a sound emitter. May or may not have impact effects.   When you call UpdateDependencies on a component it can then test to see if any of those optional components are connected and setup the dependency tree only if they are.   It can be a real pain in the proverbial when you have to track down an update order bug, but once you have tracked down the bug, fixing it is as easy as adding one more call on the dependency helper.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!