As long as you aren't DllImporting something from a windows-specific library, Mono should be able to run it just fine. OpenTK gets around this for OpenGL bindings by using Mono's "dllmap" configuration setting that lets you automatically redirect opengl32.dll calls to libGL.so.1, openal32.dll calls to libopenal.so.1, etc.
[editline]27th January 2012[/editline]
Also my friends and I opted for IronPython instead of Lua in our game, runs on the Dynamic Library Runtime, which is built on top of the CLR.
I got empty saves (no chunks) working.
Saving chunks should work after I add a constructor for the octree object.
It doesn't reuse space in the blob files for now, but it's reusing strings.
[QUOTE=Ziks;34419934]Doesn't it run with Mono?[/QUOTE]
Mono isn't native Linux and is a horrid experience for me. I'm exaggerating my opinion by saying we've already ditched Linux compatibility. It's like running programs in a non-functional game boy emulator.
Wine is no different, but it could probably handle the lua unlike mono; which is why I don't have a problem with you implementing lua.
[QUOTE=Naelstrom;34422823]Mono isn't native Linux and is a horrid experience for me. I'm exaggerating my opinion by saying we've already ditched Linux compatibility. It's like running programs in a non-functional game boy emulator.
Wine is no different, but it could probably handle the lua unlike mono; which is why I don't have a problem with you implementing lua.[/QUOTE]
The Mono runtime is native to every OS it works in. It's another implementation of the .NET framework that reads the same bytecode and does very similar JIT compiling on it to produce native instructions. In my own projects I've been able to match the performance of the .NET runtime almost exactly. Using AOT compiling you can skip the runtime compiling and create a native Linux binary as well. (Known as NGen in the MS implementation)
Wine is just an emulation layer over Win32 which redirects specific calls and hopes that the differences in implementation don't break. Mono can handle lua if you distribute both Windows and Linux binaries of the native code it relies on, but that's not set up by default.
Excuse me, I guess it's because all the mono programs I've ever tried never follow any Linux specifications or are never even debugged within Linux. Causing it to misbehave.
Just know Mono isn't a panacea for compatibility please.
It's not instant compatibility with all C# programs, no... but if you set out to write some code that works under both Mono and the .NET framework, it's not too difficult to do. If we choose to avoid platform-specific code, Linux/OSX support isn't going to be that hard to maintain.
You can also use [url=http://www.mono-project.com/MoMA]MoMA[/url] to see what parts of an existing program won't work under Mono.
I just tried out the revision with the sloped rocks.
I think the corner tiles with sloped diagonals and horizontal diagonals should be distinct blocks, so structures are orientation independent in all 4 cardinal directions.
It would make sense if they broke into different amounts of resources.
Would be cool if blocks turned into high edge slopes, inverse pyramid slopes, then half slopes, pyramid slopes and finally lower edge slopes depending on where they're hit.
The resources could be counted in exactly 1/6th of a block that way.
There's a z-fighting problem with the bottom triangle of the lower edge slopes.
The current slopes were just a quick test, I was planning to have all single-corner slopes have the same shape in all 4 directions and not have the triangle that clashes with the face of the block underneath.
There we go:
[img]http://i.imgur.com/ht2Zf.png[/img]
Still some work to do on them, including removing the unnecessary depth fighting triangle. Sorry for being slow but I caught something over the weekend.
[QUOTE=Ziks;34484117]There we go:
[img]http://i.imgur.com/ht2Zf.png[/img]
Still some work to do on them, including removing the unnecessary depth fighting triangle. Sorry for being slow but I caught something over the weekend.[/QUOTE]
That's marching cubes right?
I don't know much about it but can it be smoothed further?
It's a sort of 2D variant of marching cubes where I only look at the cubes on the upper surface, and the different face configurations are fixed.
[editline]31st January 2012[/editline]
This is as far as I'm going to smooth it, but if anyone wants to have a go at continuous marching cubes then please fork it by all means.
That's fantastic! One of my major grips of 3d tile games is being forced to bunny hop to get around.
[QUOTE=Ziks;34484616]It's a sort of 2D variant of marching cubes where I [b]only look at the cubes on the upper surface[/b], and the different face configurations are fixed.[/QUOTE]
How does this handle caves, mines and overhanging cliffs?
[editline]-[/editline]
[QUOTE=Ziks;34492601]I'll probably revisit this later, I just don't want to get stuck on one area for too long or I'll lose motivation.[/QUOTE]
Smart man!
Simple: it doesn't. I'll probably revisit this later, I just don't want to get stuck on one area for too long or I'll lose motivation.
Networking next!
[editline]1st February 2012[/editline]
It would really help if someone else worked on the smoothing so I can think about something else, the relevant code is in [url=https://github.com/Metapyziks/MarsMiner/blob/smoothing-test/MarsMiner.Shared/Geometry/PerlinGenerator.cs]Shared/Geometry/PerlinGenerator.cs[/url] and [url=https://github.com/Metapyziks/MarsMiner/blob/smoothing-test/MarsMiner.Client/Graphics/GeometryModel.cs]Client/Graphics/GeometryModel.cs[/url] in the [url=https://github.com/Metapyziks/MarsMiner/tree/smoothing-test]smoothing-test[/url] branch.
Basic saving and loading are working properly now.
(Only the part that reads and writes files directly, I haven't wired up anything to the main program yet.)
The dll's interface so far:
[csharp]//Create new save in empty folder:
var gameSave = GameSave.Create(savePath);
//Open existing save:
var gameSave = GameSave.Open(savePath);
//Saves must be closed with
gameSave.Close(); // (this part only closes the file handles for now)[/csharp]
The block classes are in versioned namespaces (currently only V0) and the core logic doesn't reference them directly, so it's possible to use more than one file version at a time (for example for updates).
Internal writes aren't 100% finished. At the moment it works this way:
[csharp]var octree = new Octree(new BitArray(new bool[] { false, false }), new byte[] { 1 });
var blockTypeTable = new BlockTypeTable(new string[] { "Block 0", "Block 1", "Block 2" });
var chunk = new Chunk(blockTypeTable, new Octree[] { octree });
var chunkTable = new ChunkTable(new int[1] { 0 }, new int[1] { 0 }, new Chunk[1] { chunk });
var mainIndex = new SavedStateIndex(DateTime.UtcNow.Ticks, saveName, chunkTable);
var header = new Header(mainIndex);
gameSave.WriteTransaction(
new Cache.WriteTransaction(header,
new Interfaces.IBlockStructure[] {
mainIndex,
chunkTable,
chunk,
blockTypeTable,
octree}));[/csharp]
I'll probably move the part where it creates the WriteTransaction into the Header.
Reading works with a generic method in GameSave:
[csharp]var header = gameSave.Read(Header.Read);[/csharp]
GameSave.Read ([csharp] internal T Read<T>(Func<Tuple<Stream, int>, Func<Stream, uint, Tuple<Stream, int>>, Func<uint, string>, T> readFunc)
{
return readFunc(new Tuple<Stream, int>(blobFiles[0], 0), ResolvePointer, ResolveString);
}[/csharp])
will be behind the layer that translates game objects into save objects.
So , will this be just a general "Whole team tries to find object X" or will it be infiniminer style two teams going directly against each other?
Overall the winning team is the one that makes the most money, but they can sabotage each other etc.
Reading and writing the file structure is (re)implemented now, as well as incremental writes and a way to reuse space.
I'll see if I can connect it to the main data tomorrow.
I just tried to make reusing space work again for 1,5 hours. Maybe I'll just make it versioned instead :v:
:suicide:
I'm working on networking at the moment, using a system where you can register named packet types which have a 2 byte identification number.
[QUOTE=TomsonTom;34418192]Just a small rant: if you really want Lua scripting, you won't get Lua interface for C# working on Linux. There's currently no Lua interface for C# that can be ran under Mono (unless you make one yourselves). If you found something, then please tell me, but right now you've got three options: no Lua / no Linux support / spend a month making your own interface working on Linux. :)[/QUOTE]
So, I found it myself. :v: There's a small library called [URL="http://code.google.com/p/parallel-tasks-simulator/source/browse/#svn%2Ftrunk%2FSrc%2FLua4Net"]Lua4NET[/URL], which is a part of a project [URL="http://code.google.com/p/parallel-tasks-simulator/"]Parallel Tasks Simulator[/URL]. Hopefully, this project is open source and under MIT license. I've tried using the Lua4NET and it [I]does work[/I] both under .NET Framework and Mono. Unfortunately, working with Lua4NET is not as comfort as working with LuaInterface. But still, it works! So if you want Lua scripting, you can have it. :)
I'm tempted to write Lua in raw c# - no dependencies on anything but .net. This should make it cross-platform and easy to modify.
Would anyone be interested in this?
[editline]6th February 2012[/editline]
Or is that what Lua4NET is..
[QUOTE=thomasfn;34575598]I'm tempted to write Lua in raw c# - no dependencies on anything but .net. This should make it cross-platform and easy to modify.
Would anyone be interested in this?
[editline]6th February 2012[/editline]
Or is that what Lua4NET is..[/QUOTE]
[url]https://github.com/mlnlover11/SharpLua[/url]
[url]http://www.ppl-pilot.com/KopiLua.aspx[/url]
[url]http://nua.codeplex.com/[/url]
Why do I get the idea that this project will actually come together , and do it well?
[QUOTE=Instant Mix;34576752]Why do I get the idea that this project will actually come together , and do it well?[/QUOTE]
Because this is more of a: Im making this game in this language, anyone want to help?
instead of the usual collabs: Lets make a game, dcide what game it is and what language and we can all start making it
I come from an art background, if you need somebody to texture or design things I would be more than happy to help you out. When I get home I can post some of my previous projects and work, just to see what you all think.
Shoot me a PM if you'd like, I don't normally go to the Programming section.
Ok, got a massive dump of stuff from my previous projects.
A mockup of the HUD in a zombie survival game.
[img]http://i.imgur.com/06Rds.png[/img]
A showcase of the alien animations in a sidescroller.
[img]http://i.imgur.com/RZhHz.gif[/img]
A pistol reload animation for a Wolfenstein-like game that never happened. I also have animations for a knife, SMG, rifle, and sniper's rifle.
[img]http://i.imgur.com/gomJW.gif[/img]
World textures for a turn based strategy game that never happened.
[img]http://i.imgur.com/doBRT.png[/img]
I made this because I was bored after playing a little bit of Metal Slug.
[img]http://i.imgur.com/CATSF.gif[/img]
Also if you need somebody to get concepts down, I've made a few endeavors into hard-surface conceptual design. Basically concept art. I pulled an all nighter to work on it.
[img]http://i.imgur.com/QBO6P.png[/img]
Finally fixed it.
[code]Blob 0: ###################################################_########################################
##############___________________###################################################################
##########################################################__########################################
####################################################################################################
###################_################################################################################
##############################################################################################______
####################################################################################################
################__##################################################################################
####################################################################################################
###############################################################################___##################
##############################################################################______################
####################################################################################################
####################################################################################################
####################################################################################################
##################################################_#################################################
############################################################################################________
____________________________________________________________________________________________________
________________________________________________###################_________________________________
____________________________________________________________________________________________________
____________________________________________________________________________________________________
____________________________________________________________________________________________________
_______________________________#####################################################################
####################################################################################################
####################################################################################################
####################################################################################################
#######_____________________________________________________________________________________________
____________________________________________________________________________________________________
_______________________________________________________________________________________#############
############################################################################################
Used ratio: 0,7083911[/code]
That's the blob file after adding 30 very small chunks one at a time to a partly fragmented save with only one chunk. Hashes are used space.
After my slight diversion to do a logic gate sim thing I'm back on this. Working on networking still with this model:
Packet types are registered by name on both client and server with a delegate for how to handle receiving that packet.
Server gives each packet a 2 byte ID, when a client connects the server sends each name/id pairing to the client.
When a packet is sent, the packet ID is sent first and the appropriate handler delegate is chosen by the receiving party.
[QUOTE=Ziks;34670182]After my slight diversion to do a logic gate sim thing I'm back on this. Working on networking still with this model:
Packet types are registered by name on both client and server with a delegate for how to handle receiving that packet.
Server gives each packet a 2 byte ID, when a client connects the server sends each name/id pairing to the client.
When a packet is sent, the packet ID is sent first and the appropriate handler delegate is chosen by the receiving party.[/QUOTE]
How about you assign each packet a name. Then in order to map the IDs, you sort them by ascending order. As long as both the client and server have the same packet listings, they will be assigned the same IDs - that way you don't need to network them across.
Sorry, you need to Log In to post a reply to this thread.