iGame3D is an open source scriptable 3D game engine and modeling project for Mac and Windows.
We switched to an all Lua with murgaLua solution around May or so,
then life happens...
...months later we have this list of things that iGame3D manipulates

Oh, by the way, the player app that comes with the svn checkout is NOT the one to execute. It is used for a framework embedding workaround in a post-link phase. So you always need to build the player yourself which will go into the "build"-Folder.

One idea to fix your link error is to remove libnewton64.a from the xcode project and rebuild. It works fine without it for me, maybe it helps you.

Oh, by the way, the player app that comes with the svn checkout is NOT the one to execute. It is used for a framework embedding workaround in a post-link phase. So you always need to build the player yourself which will go into the "build"-Folder.

One idea to fix your link error is to remove libnewton64.a from the xcode project and rebuild. It works fine without it for me, maybe it helps you.

Good luck

my result:
15 errors when trying to build
Are you interested in more details ?

--define a function for the game loop
function gamemodefunc()
setText_boxInfo(gTextboxes[1], IG3D_TEXT, time())
fltk_update();
char,code,name=input(false)
--Toggle to edit mode on escape key down
if name=="Escape" then ig3d_SetMode_i(1) end
end

--define a function to handle editing mode events
function editmodefunc()
setText_boxInfo(gTextboxes[1], IG3D_TEXT, time())
fltk_update();
char,code,name=input(false)
--Toggle to play mode on escape key down
if name=="Escape" then ig3d_SetMode_i(4) end
end

game_func= gamemodefunc--tell engine what the game loop is
edit_func= editmodefunc--tell engine what the edit loop is
ig3d_SetMode_i(4) --- play game!

Hi,
I give up, trying to compile the code at Leopard now ;-(
Coming back when seeing a sign at svn update :-)

In the meantime I try to understand the idea of your engine and murgaLua integration... I think, it seems to be a perfect environment for pseudo simulation (game like) robotics... Virtualisation ist the first step for my idea - simulation physics the next part :-)

I had a longer post, now lost to the ether, a more complex script was created for this demonstration but here's a quick and dirty version to demonstrate object creation at its leanest and direct translation of the object in space via the keyboard WASDRF keys.

--define a function for the game loop
function MoveBoxWithWASDRF()
objectSpeed=0.02
--control the object with keyboard
fltk_update();
char, code, name=input(false)
--forward and back
if key("w","-") then zm= -objectSpeed end
if key("s","-") then zm=objectSpeed end
if zm~=0 then xm,ym=0,0 end
--left and right
if key("a","-") then xm= -objectSpeed end
if key("d","-") then xm=objectSpeed end
if xm~=0 then zm,ym=0,0 end
--up and down
if key("r","-") then ym=objectSpeed end
if key("f","-") then ym= -objectSpeed end
if ym~=0 then xm,zm=0,0 end
--stop the motion with spacebar
if key(" ","-") then xm,ym,zm=0,0,0 end

--tell engine what function to loop in game mode
game_func= MoveBoxWithWASDRF

-- for now edit is the same as game loop
edit_func= MoveBoxWithWASDRF

ig3d_SetMode_i(4) -- play mode!

The same basic code can be used to create and manipulate other entities in the iGame3D scene. In a game scenario we don't manipulate objects so directly, we use physics, which I'll demonstrate soon with this robot thing in mind.

Perhaps a simple robot emulation program for me to test?
What data will the robot and 3D scene share?

You can use PNGs (and only PNGs) for your textures.
Those textures can be applied to both dynamic objects and the static world, ie brickwalls. We'd be glad to see some robot action happening in iGame3D!

Getting back to the linking problem:
Obviously there is a problem with the newton physics engine.
It would be great help if you could download the mac version of this engine from http://www.newtongamedynamics.com and try to build it with your xcode and tell us the results of this of course

Regards,

Tobi

chrimo Wrote:

Hi,

I use a very simple testprogram for my old simulation with murgaLua...
It uses a field of LEGO-brick and walls, moving around and should never collidate
with the walls :-)

What format is used for the moving object ?
Are png's OK for the static objects (bricks for the wall) ?

Thanks for testing that.
Hm, ok, then it might not be newton. I guess we need to buy Leopard to sort out the problems. But so you can still try iGame3D I have uploaded the universal binary build of the player application tohttp://www.igame3d.de/player.zip

You can download it from there and put it into /ig3d_mac_xcode/build/Development

Do you have the folder /ig3d_mac_xcode/Data ?

If not, you should cd into ig3d_mac_xcode and checkout the Data folder from svn into it.

Now you should be able to run this player in the Development folder. (Without the Data folder it will launch and present a grey window only).

Hm, ok, then it might not be newton. I guess we need to buy Leopard to sort out the problems. But so you can still try iGame3D I have uploaded the universal binary build of the player application tohttp://www.igame3d.de/player.zip
[quote=chrimo]
Result:
download, extract, double click xcode.project-file, build and run...

The earth rotates very fast !

Hi Tobi,

your precompiled Player works out of the box with Leopard !!!

I got your "hello work" just this moment :-)
This will be a very nice startup point for more test :-)

1. how can I open/run own scripts with your player (cmd line or open requester) ?
Currently, I have just patched the default "game script.lua" inside the Player.app for my tests...
2. Are these demo-snipsets available as downloadable scripts ?

The model format for non-static objects is WTF.
iGame3D can import 3DS, OBJ, and LWO files and export the WTF file.

We also have a WTF exporter for AC3D, which I think supports the Lego format.
We have another exporter for Blender, but I believe it may not support textures.

chrimo Wrote:

Are png's OK for the static objects (bricks for the wall) ?

For a simple fast approach, you may want to use modified clones of the WTF files "square" and "cube"

Square.wtf can be thought of as a sprite.
Its four corners, 2 polygons, 1 face, it can be solid, mobile, and you can make an unknown amount of equally controllable clones.

Lets look inside this file at its Materials properties.
I'm going to comment some data but normally thats not in a WTF file.
I also removed OpenGL's extra zero's.

Code:

#Materials: -- here's the header to search for in a WTF
1 -- number of materials on this object
acmat_0 -- the material name..this model came from ac3d
13 -- number of properties the material has
smooth=0
color=1.0,1.0,1.0,1.0
ambient=0.20,0.20,0.20,1.0
diffuse=0.80,0.80,0.80,0.80
specular=0.0,0.0,0.0,1.0
shininess=0.0
emission=1.0,1.0,1.0,1.0
blend=1
wire=0.0
depth=1
-- Just modify a path at these lines to change textures.
texture=1,Data/Images/BrickRoomLarge_wtf.png
texture=2,Data/Images/cloud.png
lux=true
2
1,0,3,1.0,0.0,0.0,0.0,0.0,1.0
3,2,1,0.0,1.0,1.0,1.0,1.0,0.0

This material currently has 2 textures, it can have more or less.

Let your imagination go wild with the uses of a flat plane wooo!

The cube is probably best to deal with, you can place it without worrying about its open behind, and scale it to meet various thicknesses.

Its texture can be replaced easily in a text editor or with scripts as well.
I'll dig for a scripting example of textures to amend this with.

While playing around I have some more questions:
1. how can I open/run own scripts with your player (cmd line or open requester) ?
Currently I have just patches the default "game script.lua"

Add a folder inside "Data/Levels/" create your script and call it "load script.lua"
When you launch the current player it will show up in the list, just click to test, you can hide some of those other level folders to make the list shorter. don't hide level "default", that makes the list of levels

You could also have a load script that simply loads one or many scripts from the Scripts folder as well. I tend to break the load scripts down into digestible smaller scripts, and then tell the load script to load all those files.

You could also redirect the game script.lua to open your level instead of level "default" .. this is the line you change for that.

Code:

if game_func==nil then loadLevel("Data/Levels/default") end

I don't like file requesters, I usually make lists that can load the available levels or models with a click or a drag. I'm not sure how far I got with that in MurgaLua last summer, looks like whatever I did I broke at some point.

There are two .sh files in the Data/Scripts/ folder, thats about as close as we've been to launching igame3d via a terminal window. I monkeyed with that for a bit, but didn't find it particularly useful. iGame3D feeds errors output to console.app, so you'll want that open from time to time to see where if things go wrong.

For a command line in the player, hit Command T after you open the program.
"Command I" creates an inspector window.

You'll find the background color script is in "ig3d_mac_xcode/Data/Fluid/background_color"

There's plenty of scripts in the Data folder to check out, especially in "/Data/Scripts/Functions/", these are used by most of the current levels available.

Also The Fluid folder is full of UI scripts, that I stopped working on as I was missing something important that ties them all together, still don't know what that is.

Hope that explained some things.

The SVN checkout should be fine, if you also grab the extra Data directory.
iFly and the other demos are in the levels folder of that, the source with binary alone are pretty much a blank slate as far as content goes.
Not sure what Tobi uploaded for you to test, its probably everything you need.

These files and directories must be present in the package bundle to operate.
core.lua should not be edited, but it is useful to read.

At application launch the file iGame3D Player.app/ Data/Scripts/core.lua is run
followed by iGame3D Player.app/ Data/game script.lua

The definition for an external Data folder of scripts and other content
is defined in iGame3D Player.app/Data/game script.lua

The default when using the SVN repository is set to 3 folders out of the application bundle.

Other situations might point inside the bundle for deployment (0) or one level (1) out of the bundle for easy editing.

These changes are easy to make by changing a value in the game script.lua.

The default game script we are using looks like this

Code:

function goDirsUp(path, numLevels)
--takes a path (with trailing /) and moves up numLevels levels and returns it
local i
local c=-1
for i=#path,1,-1 do
if string.sub(path, i,i)=="/" then
c=c+1
end
if numLevels<=c then return string.sub(path, 1,i); end;
end
end

--originating application path
bundleroot = getSceneInfo(IG3D_ROOT)

Set the value here to set the distance from the application bundle to the data folder.

Code:

gameroot=goDirsUp(bundleroot, 3)

Its default is at three to find the file outside of build/Development/iGame3D Player.app/
If you put your levels and content into the Data folder of the package you'd set the value to 0, or simply replace the line with gameroot=bundleroot
If you drop your Data folder in the same folder as the app, set the value to 1

Windows doesn't have packages so we keep the Data folder in the app path

Code:

if murgaLua.getHostOsName()=="macos" then
setSceneInfo(IG3D_ROOT,gameroot) --custom gameroot
end
gameroot=getSceneInfo(IG3D_ROOT)

Now that we can find our Data we branch to customizable scripts.
The default level is a menu and loads functions to activate the console,
inspector, and a missing script editor.