Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

3002 Excellent

1 Follower

About Sik_the_hedgehog

  • Rank

Personal Information

  • Interests


  • Github

Recent Profile Visitors

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

  1. Sik_the_hedgehog

    Things to consider a game in my language into English

    The usual suggestions for localization will do (they apply to all languages), look them up. Put all strings that could show up on screen into a file and let the game load them from there, and try to avoid making strings on the fly as much as possible (better to repeat text than to risk ending up with something that isn't gramatically correct in another language) (???)   Probably the biggest thing to worry about (aside from text itself) in your case is space. English is going to take more space on screen and likely in memory as well, so you need to account for this issue (if it doesn't allocate enough memory as needed then at least make sure it allocates a lot of it, better to waste than having the text not fit). Some other languages are even worse at this.
  2. Sik_the_hedgehog

    Why didn't somebody tell me?

    Press Shift+Space in the browser to scroll up instead of down.   Not sure on which browsers it works but I can confirm it works on Firefox and somebody said it works in Chrome too.
  3. Sik_the_hedgehog

    How does this ever work.

    I think the check was that if the size is zero, then the data doesn't exist (hence no pointer is needed).
  4. Sik_the_hedgehog

    Unmaintainable code

    I can't believe I just fell for it again   (waiting for the code in that post to load... then I remembered it shouldn't take even a second and then what software this was from)
  5. Sik_the_hedgehog

    ASCII C++ Graphics Library

    Yeah just make your own. It's essentially just a tilemap, with your tiles being each glyph. May want to take advantage of that to do Unicode as well (getting access to a lot more of useful glyphs in the process). The downside is that you'll have to provide the glyphs =P (I have a bunch from an old project, 16×16 per glyph though)
  6. Sik_the_hedgehog

    What to do besides fencing?

    Guys, I'd already go bonkers if a full rebuild took over a minute for me =/ (and of course I normally build like after about every change so in practice it's more like 3 seconds since only one or two files need to be rebuilt)   I once did this but because the IDE was broken (no idea what happened) and was refusing to take my static libraries so I went the overkill way of literally #including them. Also for whatever reason it wasn't keeping track of headers so I had to do full rebuilds no matter what (it was an awfully broken install, OK?). Then I noticed that if I just had a single file that #included every other file (which happened to work in my case) the build time would go down from over a minute to like 5 seconds. I have no idea what's going on but I guess that spawning the compiler process is even worse than the compiling itself.
  7. Does the shortcircuiting matter here actually? I imagine the compiler should be able to optimize out cases where it notices that operations can be done in either order and it not affect the outcome.   EDIT: did some quick tests myself and... well, GCC does indeed fail to optimize that out. Whoops. Also pretty disappointed overall this time, GCC really didn't try to do anything clever regardless of what I threw at it. I guess there isn't much else to be done about it (assuming the code is already cache coherent). Then again I recall reading that CPUs now try to keep track of where recent branches tend to go? On code that's run on a tight loop that should already help reduce branch mispredictions after a few iterations.
  8. Sik_the_hedgehog

    Moving from plain "ascii" to XML?

    Wait, that parser can only accept the options if they come in that exact order? (even though each line starts with the name of the relevant setting) Yeah, especially if you changed something that keeps crashing the game miserably and want to undo it. Being able to edit the settings directly makes this task easier. It's also a good place to put obscure settings that normally wouldn't be useful (i.e. extremely advanced stuff) but that somebody may want to give a try.
  9. Sik_the_hedgehog

    Moving from plain "ascii" to XML?

    As has been said before the current format is already much simpler than XML... I wouldn't bother with XML unless you end up with complex enough structures to warrant deep trees. Doesn't look like that's the case here.   If you really want to switch to something more standard, I guess you could go with INI files, though there's a bunch of libraries out there to look for... and it may even be feasible to just write your own parser (the main reason they took off back then is that they're that simple, after all). Or even modify your own, I mean, replace the space with an equals sign and you're halfway there =P
  10. Sik_the_hedgehog

    When you realize how dumb a bug is...

    The problem in many cases is that you read what you think you wrote, not what you actually wrote. That tends to contribute to typos being so hard to find. Once you're tired of looking for an obvious mistake you'll just start rereading everything carefully again just to try to overcome that issue.   Of course there's also the complementary problem where you waste the whole day looking for a dumb typo, and then you realize the problem is that the algorithm is broken in the first place...
  11. Sik_the_hedgehog

    Fast Approximation to memcpy()

    Reminds me of what Nintendo did with the Wii (for context: they compared keys using strncmp instead of memcmp, so all you needed was to use a key that's all zeroes and the console would take it as a valid disc) http://thedailywtf.com/articles/Anatomii-of-a-Hack
  12. Sik_the_hedgehog

    Fast Approximation to memcpy()

    Don't forget about overcommiting. Enjoy processes dying out of nowhere without any warning or explanation.   As for speed, reminds me of a situation I had with memcmp. Apparently at least on some implementations it's optimized for comparing large chunks of data when I was using it to compare a few bytes instead - but not a fixed amount so the compiler can't just unroll it. And this was in a tight loop. Turns out that the overhead of preparing for a large comparison outweighted the benefit, to the point that simply adding a simple check for the first byte (since most comparisons would fail) would speed it up like crazy.   Just because the standard library is probably better optimized than what you can do doesn't necessarily mean it'll be best optimized for your actual case.
  13. Sik_the_hedgehog

    Why didn't somebody tell me?

    Yeah the multiple formats one is intentional, for example you can have both rich text and plain text too, that's how programs don't barf when trying to paste text from elsewhere.   It actually goes all the way back to Windows 1. The original idea was basically the Unix philosophy but in GUI form: each program was good at handling one task, and they communicate with each other through the clipboard (much like the pipe does on the command line in Unix). Just look at this presentation (skip to 3:29 if needed), dBase handles a database but can copy an entire field into Write as text, Chart can generate a basic pie chart but not much more but it can copy that chart into Paint as an image (which you can use to make it prettier). Write then can also take the image from Paint to embed it into the document (and if you didn't care about making the pie chart pretty, you could just copy from Chart directly into Write, again as an image).   Kind of amusing how we settled on mamooth programs that try to do everything on its own instead when that was the very thing Windows was intended to prevent.
  14. Sik_the_hedgehog

    Things I wish I had never heard

    Yeah, converting the PNG to 8-bit with dithering is another option (that turns out to save a lot of space), though not everybody likes the dithering and also has a serious potential to backfire if there are too many hues. Still probably the best option when you have control over what images are processed though, especially at high resolution. As for JPEG 2000, I think it also has the issue of nearly nothing supporting it, at least as far as everyday use goes (IIRC it has way more support in the professional side of things).   In any case the original point wasn't so much this but rather the suggestion of using javascript for an horrendously expensive operation =P
  15. Sik_the_hedgehog

    Things I wish I had never heard

    PNG compresses much worse for things like photos or the like (PNG is good at flat shades and gradients), but JPEG can't support transparencies at all so you're forced to stick with the rectangular shape. JNG is meant to be a middle point that uses the best part of both (see how its name is a mix of JPEG and PNG, even). Browsers don't support it though, so probably your best choice here is to split it into two files (a JPEG and a PNG) and merge them in a canvas. Or you can be careless, parse the format yourself in a script, then bring the browser to a halt because of how much CPU time and RAM you're hogging by doing that. Especially if the image is large.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!