Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Jul 2003
Offline Last Active Yesterday, 03:36 PM

#5181083 Quadtree vs multiple resolution grids for terrain rendering

Posted by swiftcoder on 17 September 2014 - 01:27 PM

Then you have free LOD on GPU



I prototyped this shortly after tessellation shaders became available in OpenGL, and while it works reasonably well, the complexity is high enough that I went back to a CPU-based CLOD setup fairly quickly.

#5179690 Diablo type attacks

Posted by swiftcoder on 11 September 2014 - 03:15 PM

Many of the weapons are purely stat based - the attackers accuracy stat and the defender's dodge stat are used to determine whether or not the attack lands, possibly modulated by the distance between them.


Other weapons are of the 'skill shot' variety, where the user actually aims, and the simulation has to determine if they hit. many of these are area-of-affect weapons (such as a cone of fire), so the checks don't necessarily need to be terribly accurate.

#5179185 Convert bit flags to indices?

Posted by swiftcoder on 09 September 2014 - 04:40 PM

Or, in the spirit of clearly expressing the programmer's intent:

for (int i = 0x1; i < 0x100; i <<= 1) {
       std::printf("0x%x\n", i);

#5177939 my SIMD implementation is very slow :(

Posted by swiftcoder on 03 September 2014 - 04:57 PM

I'm certain that this did not happen before I started doing the SIMD version of my Vec4

Random aside: this is one of the reasons I suggest everyone use version control software (even for local development), as it lets you walk back a few days in your projects history and make an honest-to-god comparison.

#5177836 For-loop-insanity

Posted by swiftcoder on 03 September 2014 - 05:57 AM

While we are in topic of loops, this is an example from one zlib game codebase I found online:

#define loop(v,m) for(int v = 0; v<int(m); v++)
#define loopi(m) loop(i,m)
#define loopj(m) loop(j,m)
#define loopk(m) loop(k,m)
#define loopl(m) loop(l,m)
#define loopirev(v) for(int i = v-1; i>=0; i--)


Is that cube/sauerbraten? I have nightmares about portions of that codebase...

#5176310 Game idea - Battle card (Hardware + Software)

Posted by swiftcoder on 26 August 2014 - 05:06 PM

Why is there a tablet on top of the display box? Are you looking at having the tablet run the game and then the box below it is specialized display hardware?

It's a holographic* box, a la something like Holho Zed.


In essence it's a variation on the same trick illusionists use to convince you that the rabbit is not inside the box...


(technically it's not a hologram. It's using the Pepper's Ghost technique)

#5173753 How can I recognize hand drawn shapes? (eg. the wizard in Trine)

Posted by swiftcoder on 14 August 2014 - 07:16 PM

Gesture recognition typically breaks down into two stages: quantizing the input into an easily-compared representation, and then comparing the result with a set of know gestures. I've experimented with a number of approaches to quantizing in the past.


Convex hull-based approaches, such as the one you describe, attempt to match the rough outline of the glyph to a set of pre-defined convex hulls. These methods tend to be fast and simple, but have trouble differentiating between similar outlines.


Stroke-based approaches quantize the input curve into discrete segments, and then compare the rate-of-change in slope and segment length against a set of predefined curves. These approaches are fast, and exceptionally resilient to changes in scale and rotation, but are heavily dependent on stroke direction (i.e. left-hand and right-hand circle are different shapes), and have trouble differentiating between shapes with matching regions of continuous curvature (i.e. circle vs ellipse).


Shape-based approaches typically rasterize the shape onto a bitmap grid, and then look for pixel similarity with a pre-defined set of images. These are a lot more robust for similar shapes, easily account for varying scale, but make it tricky to deal with rotations.


And of course, once you have quantized the input like this, there are always a whole host of machine learning techniques which can be applied to the problem...

#5170772 creating a compiler for my engine using LLVM

Posted by swiftcoder on 31 July 2014 - 08:48 PM

LLVM is a compiler

LLVM is not really a compiler. It's more of an set of optimizer passes attached to an assembler, that defines a (mostly) portable assembly language, and happens to provide some libraries to help compiler developers.


You still have to write a good portion of the compiler yourself. At the very least, the lexer/parser, type checker and code-gen layers.

#5170583 Your Prototyping Language?

Posted by swiftcoder on 31 July 2014 - 06:55 AM

I tend to prototype in Python for tasks that involve text-processing, and C++ for graphics-related tasks. Occasionally I'll need a stricter type system, and I'll pull up Scala, or even Rust (though it really isn't mature enough at this point).


C++ strikes a lot of people as an odd choice for rapid prototyping, but I've found that even many experienced C++ developers don't seem to realise just how powerful and compact the language is. It's not uncommon that I'll take a 300-400 line Python program, and transcribe it to ~250 lines of C++, with dramatic performance gains...

#5170487 I am looking for a list view in Cocoa to handle a massive amount of data

Posted by swiftcoder on 30 July 2014 - 08:18 PM

The old-school, programatic approach would be to continue using NSTableView, and just implement the NSTableViewDataSource protocol directly (which just involves returning the item count, and the individual items as requested).


The more modern and Mac'ish approach would be to define your data backend using Core Data, and then just bind your existing NSArrayController to the data model, at which point everything will Just Work™ with the NSTableView you already have.

#5169352 What is super().__init()

Posted by swiftcoder on 26 July 2014 - 01:17 PM

super(Player, self) says 'give me an object representing the parent class of self', where 'self' is python convention for the current instance. .__init__(...) is calling the constructor on that object, which will be the constructor defined in the parent class.


If that doesn't make sense, you'll need to read up on classes and inheritance.

#5169331 Why Dune (game) will never be made again

Posted by swiftcoder on 26 July 2014 - 10:57 AM

(since I poked at this a little while back, might as well add the information here)


There have been 5 published games in the Dune franchise, plus another that never made it to release:

- Dune (Cryo Interactive, published by Virgin Interactive)

- Dune II (Westwood Studios, published by Virgin Interactive)

- Dune 2000 (Westwood Studios, published first by Virgin Interactive, later EA)

- Emperor: Battle for Dune (Westwood Studios, published by EA)

- Frank Herbert's Dune (Cryo Interactive, seemingly self published)

- DUNE Generations (Cryo Interactive, cancelled)


Now, Emperor: Battle for Dune and Frank Herbert's Dune were both published in 2001, so at that point both EA and Cryo both possessed some rights to produce video games under the franchise. Cryo went bankrupt shortly after (at least in part due to poor sales of Frank Herbert's Dune), and had to cancel DUNE Generations. Cryo was mostly absorbed by Dreamcatcher Interactive, but a few years later Microïds seems to have acquired the complete rights to Cryo's intellectual properties.


However, from digging around the internet, it appears that EA's rights lapsed shortly after publishing Emperor: Battle for Dune, and that Cryo didn't hold the rights either at that time - instead SyFy had acquired bundled TV and video game rights when they produced the Dune miniseries, and SyFy contracted Cryo to build the game. SyFy held some portion of those rights till at least 2003, since they produced another miniseries as a sequel which was released that year.


After that, it appears that Paramount optioned the rights to produce a new Dune film in 2007, but they let the option lapse in 2011 after failing to secure the necessary funding.


It seems a fair guess that all rights have since reverted to the Herbert Limited Partnership, which typically appears to prefer licensing the rights as a bundle (TV, film, video games, etc), but I couldn't say for sure.

#5168996 How to make unique and interesting planets (4X)?

Posted by swiftcoder on 24 July 2014 - 04:39 PM

- Forerunner Tech

Procedurally generate the remnants of an ancient space empire that spanned your local sector of space. Player may spent some portion of their resources on archaeology, which can (on a small and randomly selected set of planets) give access to ancient artefacts and technologies. 

#5166733 Storing position of member variable

Posted by swiftcoder on 14 July 2014 - 08:10 AM

Since I have both the class and member type, I can actually store the pointer-to-member as a void* alongside the declaration data, and cast it back when I want to use it... at least I hope this works the way I think about it, I'll at least give it a try.

This is not safe.


There is no guarantee that a pointer-to-member is the same size as a regular pointer, which will lead to some interesting results if you cast between them.

#5166610 Memory alignment problem (CPU and GPU)

Posted by swiftcoder on 13 July 2014 - 02:15 PM

Since I 'm using 16 bit normals, should I use another type instead of XMFLOAT4A ? (if yes, which one could I use ?)

XMHALF4, would likely be what you need.