Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Leaf

Pages: 1 2 [3] 4
31
Programming / Re: Grid-Based Lighting
« on: August 14, 2012, 05:46:43 PM »
I make objects that cast light register the brightness of light that they are casting into squares with those squares, when the object that is casting light moves.  That way there is only a FOV calculation once when the light source moves, instead of every time something looks at a square.  When the object moves again, it deregisters itself from the squares that it previously registered with, recalculates, and re-registers itself with the new squares.

The set that the light levels are registered in is a priority list, such that the brightest value stays on top and the dimmer values sort lower through the list.

When something looks into a square, the engine peeks at the top value of that priority list, and uses that value as the light level in that square.

32
Programming / Re: Multiplayer in Roguelikes
« on: August 14, 2012, 05:38:31 PM »
I'd build it like a MUD engine, except with a roguelike object graph.

When outside of combat, it's an asynchronous free-for-all.  When combat commences, the combatants get locked into a recurring timer, where you input your action and then it "goes off" when your turn ticks around.  If you don't enter an action, it just makes a normal attack for you.

33
Programming / Re: clean code
« on: August 14, 2012, 05:34:40 PM »
I think the cleanest way to implement a game like this would be to use an OO language to build an engine with an event-driven paradigm around various interfaces.  Perhaps with some sort of compositional object model to get rid of the boilerplating problem.

Java and C# would do it pretty well.  C++ would do it but might get messy.  Old procedural languages like C, forget it. :3

34
Programming / Re: Recursive shadowcasting wrong in wiki?
« on: January 05, 2012, 07:20:51 PM »
They're more of a placeholder until we can get a better graphics artist,  though this is a school project so they don't really have to be top-notch. I'm not really a great artist but I wanted to try it out since I'll have to make my own because I don't know anyone who can draw. Practice makes perfect, eh?

I think your graphics look pretty cool.  But if you really don't like them, google "rltiles".  Decent-ish public domain 32x32 tiles for Crawl and Nethack.

35
Programming / Re: Recursive shadowcasting wrong in wiki?
« on: January 05, 2012, 07:15:29 PM »
It should be faster in general than a similar implementation done recursively.  Iteration is almost always faster than recursion (every time you call or return from a method, a stack frame gets either pushed on or popped off the runtime stack behind the scenes.  This is a relatively expensive operation compared to the simple integer increments usually associated with iterative operations.

A bigger factor will be the access time of the structures you are storing your data in.  The algorithm I posted is suboptimal from the standpoint of adding all the visible points to a results collection that has to be iterated over again when you draw the cells, and that it makes calls to abstract methods to look into your data structures.

I wrote it that way so it'd be pretty much plug-n-play into other people's code, though.  Extend the class, implement a couple of abstract methods, bang done.

If you wanted to optimize for speed, you could instead process the points as soon as they are found, rather than adding them to the results set (this will make it process the |1.0| slope diagonals twice, though).  You could also inline the stuff that is currently being handled by those abstract *Impl methods to remove some more stack overhead (though I suspect that the optimizer is probably inlining them anyway).  Small gains could probably also be made if you were clever enough to convert the whole thing to use integer math instead of floats, though the prospect of doing that makes my head hurt too much for the small gains I think it would produce.

If ya want my (possibly stinky) opinion though, be careful to avoid falling into the premature optimization pit. :P  Write your game using the clearest, most straightforward code possible to begin with, even if it's slower.  Then later on run it through a profiler if you have to, identify the parts that are actually producing bottlenecks, and optimize only those parts, and only as much as gives a real efficiency improvement at a fair tradeoff of readability.  It's a heck of a lot easier to maintain slower but clearly written code 12 months later after you've forgotten how it works, resulting in fewer bugs over the life of the product....

Indeed, I like to make a copy of the clean code before I optimize it.  Typically I leave it in the same source file, commented out.  Then if a bug needs fixed in there later, I roll back to the unoptimized code, fix the bug, and then reoptimize it.

Anyway, that's the Leaf Rant for today. ;P  Sorry for rambling on at such length, lol.

36
Programming / Re: Recursive shadowcasting wrong in wiki?
« on: January 05, 2012, 01:19:59 AM »
Shadow casting is weird like that...  It's a tradeoff between accuracy and visual appeal.

You may have better luck with restrictive precise angle shadow casting.  Java, but I am sure you can adapt it to the language of your choice.  This code is not thread-safe (unless of course you use a different instance in each thread).

Don't forget to post-process to make visible any walls adjacent to any visible floors.

Code: (java) [Select]
/*
 * Copyright (c) 2011, L. Adamson / Dizzy Dragon Games. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * We'd love to hear from you if you're using this software for something or
 * have any questions or comments. You can contact us at via email at
 * support@dizzydragon.net.
 */

package retrocrawl.engine.game.visionandmovement;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

abstract public class FieldOfView2dRpas extends FieldOfView2d
{
private static final long serialVersionUID = 1L;

// This value can be 1, 2, or 3.  It indicates the number of angles that
// must be blocked before a cell is considered opaque.
final private static int PERMISSIVENESS = 2;

// This value spreads the start and end angles a little wider than usual.
// This acts somewhat like permissiveness, but is a more fine-grained
// control.  It helps to eliminate some visual artifacts.
final private static float OUTER_ANGLE_SWEEP = 0.2f;

final private static class AngleRange
{
private float startAngle;
private float endAngle;

private AngleRange( float startAngle, float endAngle )
{
this.startAngle = startAngle;
this.endAngle = endAngle;
}
}

protected FieldOfView2dRpas()
{
super( true );
}

final private ArrayList<AngleRange> blockedAngles = new ArrayList<AngleRange>();

final private boolean isBlockedAngle( float angle )
{
for( AngleRange ar : blockedAngles )
{
if( angle >= ar.startAngle && angle <= ar.endAngle )
{
return true;
}
}
return false;
}

@Override
final public Set<FieldOfView2dCoordinate> getFieldOfViewFromImpl( FieldOfView2dCoordinate origin, int radius )
{
HashSet<FieldOfView2dCoordinate> results = new HashSet<FieldOfView2dCoordinate>();
results.add( origin );
for( boolean flip = false; ; flip = true )
{
for( int xdir = -1; xdir <= 1; xdir += 2 )
{
for( int ydir = -1; ydir <= 1; ydir += 2 )
{
blockedAngles.clear();
boolean lineOpen = true;
for( int line = 1; line <= radius && lineOpen; line++ )
{
lineOpen = false;
for( int cell = 0; cell <= line; cell++ )
{
int x;
int y;
if( flip )
{
x = line*xdir;
y = cell*ydir;
}
else
{
x = cell*xdir;
y = line*ydir;
}
float range = 1.0f/(float)(line+1);
float startAngle = range * (float)(cell);
float midAngle = startAngle + range*0.5f;
float endAngle = startAngle + range;
startAngle -= range * OUTER_ANGLE_SWEEP;
endAngle += range * OUTER_ANGLE_SWEEP;
int nBlockedAngles = 0;
if( isBlockedAngle(startAngle) )
nBlockedAngles++;
if( isBlockedAngle(midAngle) )
nBlockedAngles++;
if( isBlockedAngle(endAngle) )
nBlockedAngles++;
FieldOfView2dCoordinate coordinate = new FieldOfView2dCoordinate(origin.x()+x, origin.y()+y);
if( nBlockedAngles < PERMISSIVENESS )
{
results.add( coordinate );
lineOpen = true;
}
if( cellIsOpaque(coordinate) )
blockedAngles.add( new AngleRange(startAngle,endAngle) );
}
}
}
}
if( flip )
break;
}
return results;
}
}

(This parent class just does some caching and the post-process filtering.  The algorithm in the first class is the one you want.)

Code: (java) [Select]
/*
 * Copyright (c) 2011, L. Adamson / Dizzy Dragon Games. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * We'd love to hear from you if you're using this software for something or
 * have any questions or comments. You can contact us at via email at
 * support@dizzydragon.net.
 */

package retrocrawl.engine.game.visionandmovement;

import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

abstract public class FieldOfView2d implements Serializable
{
private static final long serialVersionUID = 1L;

final public static class FieldOfView2dCoordinate implements Serializable
{
private static final long serialVersionUID = 1L;

private int x;
private int y;

/**
* Instantiates a new FieldOfView2dCoordinate with the specified x and y values.
*
* @param x
*            the x coordinate
* @param y
*            the y coordinate
*/
public FieldOfView2dCoordinate( int x, int y )
{
this.x = x;
this.y = y;
}

/**
* @return the x value of this coordinate.
*/
public int x()
{
return x;
}

/**
* @return the y value of this coordinate.
*/
public int y()
{
return y;
}

@Override
public int hashCode()
{
return x ^ Integer.reverse( y );
}

@Override
public boolean equals( Object o )
{
if( o instanceof FieldOfView2dCoordinate )
return ( (FieldOfView2dCoordinate)o ).x == x && ( (FieldOfView2dCoordinate)o ).y == y;
return false;
}

@Override
public String toString()
{
return x + "," + y;
}
}

private boolean requiresPostProcessing = false;
final private HashMap<FieldOfView2dCoordinate,Boolean> opaqueCells = new HashMap<FieldOfView2dCoordinate,Boolean>();
final private HashMap<FieldOfView2dCoordinate,Boolean> cellContainsData = new HashMap<FieldOfView2dCoordinate,Boolean>();

protected FieldOfView2d( boolean requiresPostProcessing )
{
this.requiresPostProcessing = requiresPostProcessing;
}

abstract protected Set<FieldOfView2dCoordinate> getFieldOfViewFromImpl( FieldOfView2dCoordinate origin, int radius );

abstract protected boolean cellIsOpaqueImpl( FieldOfView2dCoordinate coordinate );

abstract protected boolean cellContainsDataImpl( FieldOfView2dCoordinate coordinate );

final protected boolean cellIsOpaque( int x, int y )
{
return cellIsOpaque( new FieldOfView2dCoordinate(x,y) );
}

final protected boolean cellIsOpaque( FieldOfView2dCoordinate coordinate )
{
Boolean isOpaque = opaqueCells.get( coordinate );
if( isOpaque == null )
{
isOpaque = cellIsOpaqueImpl( coordinate );
opaqueCells.put( coordinate, isOpaque );
}
return isOpaque;
}

final protected boolean cellContainsData( int x, int y )
{
return cellContainsData( new FieldOfView2dCoordinate(x,y) );
}

final protected boolean cellContainsData( FieldOfView2dCoordinate coordinate )
{
Boolean containsData = cellContainsData.get( coordinate );
if( containsData == null )
{
containsData = cellContainsDataImpl( coordinate );
cellContainsData.put( coordinate, containsData );
}
return containsData;
}

final public Set<FieldOfView2dCoordinate> getFieldOfViewFrom( FieldOfView2dCoordinate origin, int radius )
{
opaqueCells.clear();
cellContainsData.clear();
Set<FieldOfView2dCoordinate> results = getFieldOfViewFromImpl( origin, radius );
if( requiresPostProcessing )
{
// This filter ensures that opaque cells cardinally adjacent to
// non-opaque cells are drawn.
HashSet<FieldOfView2dCoordinate> resultsBuf = new HashSet<FieldOfView2dCoordinate>( results );
for( FieldOfView2dCoordinate c : resultsBuf )
{
if( !cellIsOpaque(c) )
{
for( int d = -1; d<=1; d += 2 )
{
FieldOfView2dCoordinate c2;
c2 = new FieldOfView2dCoordinate(c.x()+d,c.y());
if( cellIsOpaque(c2) && cellContainsData(c2) )
results.add( c2 );
c2 = new FieldOfView2dCoordinate(c.x(),c.y()+d);
if( cellIsOpaque(c2) && cellContainsData(c2) )
results.add( c2 );
}
}
}
// This filter ensures that ordinal corners next to two adjacent
// cardinal opaque cells which are next to a non-opaque cell in
// a convex fashion are drawn.  (That is, it gets rid of the
// missing corner syndrome.)
resultsBuf = new HashSet<FieldOfView2dCoordinate>( results );
for( FieldOfView2dCoordinate c : resultsBuf )
{
if( !cellIsOpaque(c) )
{
for( int dy=-1; dy<=1; dy+=2 )
{
for( int dx=-1; dx<=1; dx+=2 )
{
FieldOfView2dCoordinate c2 = new FieldOfView2dCoordinate(c.x()+dx,c.y()+dy);
if( cellContainsData(c2) && cellIsOpaque(c2) )
{
FieldOfView2dCoordinate c3a = new FieldOfView2dCoordinate(c2.x()-dx,c2.y());
FieldOfView2dCoordinate c3b = new FieldOfView2dCoordinate(c2.x(),c2.y()-dy);
if( cellIsOpaque(c3a) && resultsBuf.contains( c3a ) && cellContainsData(c3a) && cellIsOpaque(c3b) && resultsBuf.contains( c3b ) && cellContainsData(c3b) )
results.add( c2 );
}
}
}
}
}
}
opaqueCells.clear(); // Allow entries to be GCed.
cellContainsData.clear(); // Allow entries to be GCed.
return results;
}

final public Set<FieldOfView2dCoordinate> getFieldOfViewFrom( int x, int y, int radius )
{
return getFieldOfViewFrom( new FieldOfView2dCoordinate(x,y), radius );
}
}

37
Other Announcements / Re: New years roguelike?
« on: January 01, 2012, 12:37:54 AM »
I'm going to be playing D&D in about 20 minutes. >_>

I'd play Dwarf Fortress, though.  It's far and away my favorite. :3

38
Traditional Roguelikes (Turn Based) / Re: A Fan Type Analysis of Roguelikes
« on: December 31, 2011, 02:03:44 AM »
NON came up with what I think is a pretty simple and elegant way to get around this for Infra Arcana.
  Shift + left  = up left
  Shift + right = up right
  Ctrl  + left  = down left
  Ctrl  + right = down right
I think this was a pretty clever solution.
I never played IA with a laptop but I'd say it's a brilliant solution, I'd like to know if other laptop roguelikers find it intuitive/satisfying. If so, this could be used to solve this 4-arrowkeys problem.

I've implemented a similar thing (the Shift key adding 45° to the angle of the pressed cursor key), and I like it quite a bit. I think this one might be even more intuitive, though.

Except for us folks that use Sun/Unix keyboard layouts (capslock and left control swapped from the way it is on a PC-101 keyboard). ;P

39
Programming / Re: Another "help the newbie get started" topic
« on: December 23, 2011, 03:45:27 PM »
For now though, I'm going to act as though any use of a goto command will result in a velociraptor attack.

I use goto to break out of deeply nested loops without having to use a bunch of flags.

Hey, I think I hear something in the underbrush...  Oh cra---  !!!!

40
Programming / Re: Another "help the newbie get started" topic
« on: December 23, 2011, 02:44:15 PM »
You get your memory leaks from not releasing allocated memory.

What does this mean?  I'm glad you asked! :P

Let's say you have some arbitrary collection (maybe an array, maybe a hash table, whatever) that indexes a bunch of stuff in the dungeon by x,y coordinate.

You create a monster.  Let's say it's a Dire Leaf.  And you put it somewhere in the dungeon.

(pseudocode)

cellsCollection.put( x, y, new DireLeaf() );

The Dire Leaf wanders about the dungeon for a while, scratching random bits of pseudocode into the walls.  Then a Corremn comes along and kills the Dire Leaf.  You must remove the dead Dire Leaf from your object graph.  Let's say the DireLeaf is at x,y.

cellsCollection.remove( x, y );

And you go on about your day.

WAIT STOP!  You have a memory leak!  Why?!?

When you instantiated the new DireLeaf earlier, the storage for the object is allocated off the heap, and you are given a pointer to it.  In languages like C and C++, you MUST always explicitly return this pointer back to the operating system, or the storage will never be reclaimed (at least not until the program exits or crashes).  We call this garbage collection.  The way you're supposed to do this varies between C and C++.

(assuming an object in C++): deadDireLeaf.delete();
(assuming a pointer to a struct in C): free( deadDireLeaf );

Well that's easy, it seems.  I suppose it is.

But as the code becomes more complex it ceases to be such, and the memory leaks start to creep in there.  Memory leaks are terribly difficult to debug, even with tools specially designed for it.  Even more difficult than threading bugs like race conditions and deadlocks.  What makes it so difficult is that your code just blithely goes about its day, running fine, until you have so much unfreed garbage that you can't allocate any more memory, at which point the program crashes.  And the stack trace you get has nothing to do with the actual source of the bug.

More modern languages like C#, Python, and Java do their garbage collection automatically.  Remember the "cellsCollection.remove( x, y )" from before?  That's all you have to do.  Assuming something else somewhere else in the program isn't holding a reference to the dead Leaf, the runtime will realize that the memory allocated to the dead Leaf is no longer in use and free it for you automagically.  This means you get to spend more time actually implementing things and less time trying to figure out why your program is suddenly using 4 gigs of ram after you've been playing for 5 hours.

What I think many people don't realize is that automatic garbage collection is actually /faster/ than explicit deallocation.  Sure, it consumes more CPU on average, while the garbage collector runs over your object graph marking and sweeping.  But the garbage collection typically runs at a lower priority than your program, so the collection happens at times when your program would otherwise be idle (sitting there waiting for you to press a key), rather than in the middle of that tight loop where you're deleting a bunch of objects.

Don't get me wrong.  I think explicit deallocation has its place.  But I believe that these days its place is firmly in the realm of bare-metal stuff, rather than high-level application programs.  That's also not to say that you can't still have memory leaks in languages that collect garbage automatically (all it takes is one little reference somewhere that is indirectly accessible from the top of the object graph), but it's much, much rarer and easier to find (often the bug that causes the leaks in auto-GC'd languages causes other problems as well, and the leak will magically disappear once you find and fix those other issues).

41
Other Announcements / Re: Roguelike Radio podcast
« on: December 23, 2011, 03:07:46 AM »
Maybe I'm not hardcore enough, but personally I don't have a problem with graphical roguelikes.  Indeed, I much prefer to play Dwarf Fortress (admittedly the only roguelike that I still play heavily) with a graphical tileset.

It by no means has to be pretty graphics, though.  I think the problem isn't a graphics vs. UI intuitiveness issue, but that the problem occurs when bling takes precedence over good design in general.  An intuitive UI is an integral part of a well designed game, and a well designed game pulls you in for the long haul.  A pretty, blingy game that has too much focus on the art and not enough on the design pulls you in for a little while while you oogle at the pretties, but you master it too quickly, become bored, and quit playing.

I'd take the intuitive UI and crappy graphics.  The horrid keymaps of Angband and Nethack are what turn me off.  They may have great depth of play, if you can get past the klunky interface, but I posit that they're still /very poorly/ designed (or became that way through feature-creep evolution).  I think DF could do with better mouse integration, but the menus are what make it (barely) intuitive enough for me to not get too aggrivated with. :P

We one or two-man hobby hacker teams just don't have the resources to sink enough man-hours into both art and design.  I think design wins out in the long run, but gosh....  There are tons of public domain graphics out there and using them (and with mouse-driven context menus in addition to the keyboard even!) is easy with a good high level UI library.  They're certainly not great graphics, but I think they're still more intuitive than an orange 'o' and a keymap that consumes the entire 7-bit ASCII space.

42
Programming / Re: Another "help the newbie get started" topic
« on: December 22, 2011, 03:52:47 PM »
Corremn++, re C#.  It's a really great language.

Also, maybe consider Java or Python.  I hear that there is a python version of that roguelike library that everyone is talking about.  I believe that it is very very easy to learn bad habits if you cut your teeth on something like C++, and you'll have a devil of a time debugging your memory leaks (which I assume isn't an issue with VB, though I've never used it). :3  I mean, if you want to do this project for the explicit purpose of learning C++, then go for it, but I predict that you'll have a harder time with the debugging, leading to frustration, and eventually to decreased chances of finishing the project altogether.

43
Programming / Re: Objective C Portability
« on: December 21, 2011, 10:42:33 PM »
I do apologize for being a little ranty in that last post. :P

I think when it all comes down to it, you should use whatever you'll have the most fun with and if it's not portable, then oh well.  The more fun it is, the more likely you are to finish it.  And if you finish it, even if it ends up less good than you want, and even if it only runs on one platform, I still expect you'll have accomplished more than 90% of us. XD

Myself included.  I haven't actually /finished/ a free-time game programming project since the Apple 2 days. :3  They sure are fun to write and then abandon when ya get to the boring parts, though..... :3

44
Programming / Re: Objective C Portability
« on: December 21, 2011, 10:59:41 AM »
Warning: Personal opinions lie ahead, and y'all know how opinions are...  I apologize in advance for any of this that turns into an early-morning pre-coffee geekrant.  :3

I like objc.  I think it's a good OO extension to C that lacks the mess of certain other C-derived OO languages.

I think if you want massive portability, it's not the best choice, though.  Yes, it will compile on many platforms, but you're going to end up linking with a bunch of native C libraries on each platform for cross-platform graphics, sound, etc, and having to not only manually manage the heap allocation associated with those libraries, but also manage the differing build process on all the platforms you want to support.

(Here's that pre-coffee geekrant. :P )  My opinion is: it's almost 2012, not 1980.  Automatic garbage collection is a wonderful thing, despite what some might say. ;P  The only reason to be managing your own heap allocation these days is if you're doing teeth-on-the-hardware OS-level stuff or targeting tiny embedded systems that don't have room for a rich execution environment.  I don't know how I didn't pull out all my hair back in the C-in-Unix day when we had to explicitly free() stuff, trying to track down those couple of obtuse memory leaks that /always/ found their way in somewhere....

(Edit: Unless you like doing your own heap management, I guess.  Diffrn't strokes and all that, I suppose, but I find that I get a lot more done per unit time without it.)

Anyway, I think if you want to write portable software, you're better off using an inherently portable language like Python, Java, or C#.  It is unfortunate that Apple has chosen a licensing scheme that makes using such languages on their handheld platform difficult. :<

I chose Java meself, explicitly because there are some tools in development at Google for compiling java apps down to native arm code that can be distributed on the Apple store and installed without rooting the machine.  The tools are still a bit too immature to mess with at the moment, imo, but I am hoping that they'll be pretty decent by the time I get this particular project complete enough to start thinking about porting it to something other than Swing and Droid.

45
Programming / Re: Let's talk a bit about world map generation!
« on: December 14, 2011, 08:57:51 PM »
Here's a pretty good paper on river generation.  Probably wouldn't work for a truly procedural world though...

http://www.cs.sjsu.edu/~teoh/research/papers/CGVR08_terrain.pdf

Pages: 1 2 [3] 4