Profile Falling Sand Game    Hell of Sand Game   Profile NEW Sand Game   Profile Pyro Sand Game Profile Pyro Sand II   
Profile X Sand    Profile Etch A Sketch Sand    Profile FSG Wiki    Profile Game Overview

realSand - Vector Physics + Lua Modding (Lua library fixed)

Discussion of programming and creation of new sand games.

realSand - Vector Physics + Lua Modding (Lua library fixed)

Postby Jacob on Sun Nov 01, 2009 10:45 am

Scroll down a bit for a download link!

History
I actually started this in C around January 2008 or so, but my bad C skills and complete non-use of OOP led to a horribly buggy and slow prototype. Recently I've been learning Java for Minecraft stuff, and decided to make a sand game with Java. So, I present to you, realSand!

Introduction
This game uses vectors for physics instead of the standard if-no-particle-below-then-move behavior, so simulation is much more realistic and modding is much more flexible. However, I tried to make it similar to the original FSGs in the way particles behave, so you can't make giant columns of sand like in the powder game, for example. Also, you can do basic modding like in most FSGs, or you can take full capability of Lua.

I know there's bad horizontal bias right now, I'll fix it later :P

There is no wind yet, since I have no idea how to do that, but with the vector collisions and physics it might not be too hard if I find a guide somewhere. Collisions are done with sectors for increased performance, and everything uses object-oriented programming.

Prototype
I don't want to sound like I'm making uncertain promises, so here is a download link.

Download prototype v2 (requires Java)

UPDATE at 5:10 ET:
-Added a simple GUI, now there can be more than 2 elements
-Physics speed improvements
-Minor physics changes to remove bias and fix some inaccuracies

Old Versions
Prototype 1

Controls: Left click to place sand, right for a "trampoline" element, and middle (press mouse wheel) for a kind of explosion (sort of). As I said, it's just a demonstration.

Modding
The game is already powered by Lua, but modding is not finished yet, although you're welcome to try (might be hard with two elements!) If you look in default.lua you can see what modding will eventually be like (later, this file will just be a library of functions, and user mods will be stored in separate files.) You can use addElement() and addInteraction() [not implemented yet] for basic FSG modding, or you can specify a collision function that is called every time a particle of the specified element hits any other particle. The trampoline is an example of this. I'll make a more complete guide to modding as I add more features and the game is closer to finished.

Please try it, and tell me if you like it! I'm going to hopefully update often.
Last edited by Jacob on Mon Nov 02, 2009 2:03 pm, edited 1 time in total.
Jacob
Level 1
Level 1
 
Posts: 99
Joined: Sat Jan 27, 2007 10:32 am

Re: realSand - Vector Physics + Lua Modding (update 5:10ET 11/1)

Postby purple100 on Mon Nov 02, 2009 10:07 am

Code: Select all
C:\Documents and Settings\Andrew\Desktop>java -jar realSand.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/keplerproject/luajava/LuaException
        at com.mynet.realsand.Sand.main(Sand.java:239)
Caused by: java.lang.ClassNotFoundException: org.keplerproject.luajava.LuaException
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        ... 1 more


Looks like I'm missing a package.
THERE'S A SPOON IN MY EAR!!!
Image
User avatar
purple100
____________________
____________________
 
Posts: 2110
Joined: Sun Mar 12, 2006 3:17 pm

Re: realSand - Vector Physics + Lua Modding (update 5:10ET 11/1)

Postby Jacob on Mon Nov 02, 2009 2:03 pm

Sorry about that, I left out the lua library by accident. I reuploaded prototype 2 with the library, and a .bat file to run the game.

It probably won't work on Mac right now; I need to find the JNI file for Mac for the library I'm using.

Edit: Also, should be a modding update pretty soon.
Jacob
Level 1
Level 1
 
Posts: 99
Joined: Sat Jan 27, 2007 10:32 am


Return to Sand Development

Who is online

Users browsing this forum: No registered users and 1 guest