Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 31 Jan 2009
Offline Last Active Private

#5166571 obj file format

Posted by Sik_the_hedgehog on 13 July 2014 - 07:23 AM

OBJ files can contain polygons with an arbitrary amount of vertices (so yes, those are quadrilaterals). You need to convert them to triangles first if you want to render them using OpenGL.


The easiest and dumb way is to just treat them like a triangle fan, but that assumes all polygons are convex (which is likely the case for most models anyway). If that works out for your data then just do that and don't worry anymore. Otherwise, you can try loading the model in a 3D editor and reexport the model ensuring all faces are turned into triangles (Blender has a checkbox that says "triangulate" if I remember correctly, don't know about other editors).

#5165924 MIT License in PlayStation Vita Game

Posted by Sik_the_hedgehog on 09 July 2014 - 07:04 PM

Stuff like this is why lawyers will object to using any third-party code you haven't explicitly licensed from the author, if there's even the slightest chance that the license can be misinterpreted you're potentially screwed.

#5165742 How important is localization?

Posted by Sik_the_hedgehog on 09 July 2014 - 12:08 AM

You can, but if you want to do it right, it's not straight forward to do automatically. You want to prioritize hyphen on the actual word parts, but to do that, you need a german dictionary!

Second priority is splitting on syllables of a word. Even harder to automate, though you can approximate it by simply splitting after the first consonant after a vowel.

Though just splitting after a consonant (and ignoring syllables and words) will likely produce lots of "weird" splits.

Honestly I've reached the conclusion that at least for games it's usually easier to just do it manually. I'm just wondering if German people would find it weird if those words got split with a hyphen.


Automatic word wrapping is fun (not). Take for example Japanese, there isn't any sort of separator between words. Your options are either to let the program split wherever it wants (including in the middle of a word), separate the words manually, or use a dictionary with every word possible to tell where word wrap should be allowed (and this last one is not necessarily foolproof!).

#5164712 simple SDL framerate?

Posted by Sik_the_hedgehog on 03 July 2014 - 08:50 PM

Is it me or is L.Spiro assuming that framerate limiting is only done for hardware limitations and not to simplify gameplay logic? (it's much easier to do things like physics if you know the interval between frames is always the same)

#5164210 simple SDL framerate?

Posted by Sik_the_hedgehog on 01 July 2014 - 08:54 PM

Not really, if I recall correctly there were timers but their resolution was like 1ms (and the documentation warned that it was usually less), that may be enough for framerate if you account for rounding errors I guess.


SDL 1.2 is deprecated and not maintained anymore though, you're better off avoiding it if possible. SDL 2.0 is actively maintained and supports modern platforms (including mobile), and fixes several issues that 1.2 used to have. It also has functions to render stuff using the GPU (SDL 1.2 couldn't do that). The biggest loss is lack of CD Audio support, but does anybody still use that for games?

#5164207 Non-fixed width fonts in games

Posted by Sik_the_hedgehog on 01 July 2014 - 08:49 PM

On the other hand, if you need only some trivial font rendering (i.e. no composite characters, no ligatures, no bidirectional rendering, etc.), really all you need is the graphic of the glyph and its width (and then you just advance the width for each character). Still may be a good idea to store that data in a file, to make it easier to modify the font.


Whether that's enough for you or not depends on which languages you're planning to support. For many languages (e.g. Western scripts and CJK), you can get away with that. If you want to support other languages, you're better off getting a TrueType renderer.

#5164203 simple SDL framerate?

Posted by Sik_the_hedgehog on 01 July 2014 - 08:41 PM

Assuming you're using SDL 2, look up these two functions:

  • SDL_GetPerformanceCounter
  • SDL_GetPerformanceFrequency

This will give you a high resolution timer you can use to calculate how much time has ellapsed since the last time you checked. With some math you can turn that into frames per second (just make sure to not discard frames that haven't fully ellapsed yet).

#5121225 Amusing glitch gallery

Posted by Sik_the_hedgehog on 04 January 2014 - 04:41 PM

Bumping because this needs more amusing glitches.




The truck crashed against the background scenery (you can tell by the smoke being vertical). Not kidding.

#5097786 Pixel art

Posted by Sik_the_hedgehog on 30 September 2013 - 04:01 AM

The problem is not whether pixelart is outdated or not, but rather whether it's good quality or not. Most indie games using pixelart have horrible pixelart, to be blunt. It's like many developers try to use it as an excuse to avoid having to make good graphics. I guess I can understand if you're just making a free game, but it happens a lot in commercial games too which must be polished in just about every area.

#5096562 This beauty...

Posted by Sik_the_hedgehog on 24 September 2013 - 10:34 PM

That's the most broken implementation of microcode I've ever seen o_____O

#5095270 BASIC

Posted by Sik_the_hedgehog on 19 September 2013 - 03:40 PM

The procedural equivalent happens all the time too (where function calls become wrappers to other calls, etc.). It's probably a good way to save time.


Want something bad? On some code I worked not long ago somebody didn't figure out how to call subroutines yet, so he resorted to using an IRQ for the job instead... To give you an idea, that's like spawning a new thread just to call a function. Yuck.

#5093524 Making a program cross-platform

Posted by Sik_the_hedgehog on 12 September 2013 - 05:06 AM

CMake actually makes it relatively easy to cross-compile programs, since it does all the toolchain shenanigans for you (just tell it what toolchain to use). Sadly many libraries use something else and generally seem to be hard to cross-compile, so unless you have prebuilt binaries for them that you can just drop in the relevant folders, it's going to be troublesome.


Using CMake is still going to save you the headache if you just build on the target platform directly, since you'd still use the same files, so in either case stick with it. You're going in the right direction.

#5089692 My OLD Syntax

Posted by Sik_the_hedgehog on 27 August 2013 - 09:50 PM

Schrödinger's braces?

#5086010 tile-based 2d "realistic" map?

Posted by Sik_the_hedgehog on 14 August 2013 - 10:47 PM

Whoops, forgot to check this thread.


These games get away with the tiled look because of autotile functionality, which adds variation between adjacent tiles of the same kind:

No idea about Ages of Empires II, but definitely not Chrono Trigger, that's just standard tiles put into good use (in fact there are still some places where tiling issues become very obvious).

#5085388 How do you triangulate faces?

Posted by Sik_the_hedgehog on 13 August 2013 - 02:00 AM

If all faces are convex (they usually are), just turn them into the equivalent of triangle fans, i.e. the first triangle is vertices 0-1-2, the next is 0-2-3, the next 0-3-4, then 0-4-5, and so on.


Alternatively, just import it into an editor and make it triangulate the faces for you =P