Oxeye Game Studio » Code Stuff http://www.oxeyegames.com Creative Games Wed, 29 Nov 2017 08:29:26 +0000 http://wordpress.org/?v=2.8.4 en hourly 1 Sand in the Gears http://www.oxeyegames.com/sand-in-the-gears/ http://www.oxeyegames.com/sand-in-the-gears/#comments Tue, 25 Feb 2014 13:32:05 +0000 kinten http://www.oxeyegames.com/?p=1457 Here comes a community update:

Hi all!

Apparently a metalface has been marooned on a tiny island in the middle of nowhere. Surviving in harsh environments with no food or water is not an issue for cyborg metalfaces but how will it avoid succumbing to insanity? How can it trust what it sees with its own two eyes/light bulbs? How will it return to civilization? These questions needs to be answered! (Looking at you Fabio).

]]>
http://www.oxeyegames.com/sand-in-the-gears/feed/ 5
Lua Binding Woes http://www.oxeyegames.com/lua-binding-woes/ http://www.oxeyegames.com/lua-binding-woes/#comments Tue, 20 Jan 2009 19:21:19 +0000 http://www.oxeyegames.com/lua-binding-woes/ Lua LogoAs you know, we’ve been using Lua to make prototypes and add mod support to Harvest. However, I’ve always thought that the C++ binding we’ve used hasn’t really worked the way I’d like it to. Basically we’ve used simple C functions to create our own Lua library for callbacks, and some Lunar objects in Harvest. Lunar allows you to do stuff such as this:

local stuff = lib.getStuff()
stuff:foobar() — call C++ member method

However, it doesn’t allow you to do this:

local stuff = lib.getStuff()
stuff.onEvent = function(self) print(”Recieved event!”) end

The problem is that with Lunar all objects of the “stuff” class share the same meta table. It’s possible to modify the meta table in Lua by calling getmetatable(), but then you will be modifying the meta table of all instances of “stuff…”

In other words I needed a new solution. A friend over at #gamedev (at QuakeNet), Joris “Interface” de Gruyter, gave me a link to a Lua in C++ article at CodeProject. That was great, it had all kinds of useful stuff, but it required the script to be run for each object because it used a “this pointer” method, such as:

this:foobar() — call C++ member function
this.onEvent = function(self) end — create callback function

I can imagine this kind of system is great for certain kinds of projects, since it cleans up the Lua code and places different objects into different Lua files. However, this was still not what I wanted! So I scratched my head a while and looked around in the code of the two options… and then I realized they were combinable!

So the solution I used was to create a new Lunar-like class (called “Lunamatic,” after a famous Akarra/Harvest player), since it had that nice member-function pointer stuff, but instead of placing the meta table information in the global scope I recreated the table for every instance of the class. As you can imagine, this is less efficient than using a shared table, so it’s not useful in every situation, but sometimes. This way I could achieve what I was really looking for, namely:

local button1 = gui.createComponent(”button”)
local button2 = gui.createComponent(”button”)
button1:moveTo(100, 100)
button1.onClick = function(self) print(”foo”) end
button2.onClick = function(self) print(”bar”) end

Since our WordPress skin isn’t suitable for code dumps, I have put the juicy stuff in our forums. For the interested, pleace follow this link: http://www.oxeyegames.com/forum/viewtopic.php?f=13&t=346

/jeb

PS. The RTS article series will continue “in 2009″ :) DS.

]]>
http://www.oxeyegames.com/lua-binding-woes/feed/ 0
Akarra Editors Source Code http://www.oxeyegames.com/akarra-editors-source-code/ http://www.oxeyegames.com/akarra-editors-source-code/#comments Sat, 26 Apr 2008 14:04:44 +0000 http://www.oxeyegames.com/akarra-editors-source-code/ AleraA few weeks ago I released the server source to our old online role-playing game, Whispers in Akarra. I thought it was time for the next piece of the puzzle, and have uploaded the files for the game’s server-side editors. You can download them from here:

http://www.akarra.net/download/get.php?file=7

The editors were created using a tool called Borland C++ Builder. Borland has since then discontinued it in favor of the Java Builder, so I’m not sure if it’s possible to get your hands on a copy any longer. In any case, some of the editors are a real mess, I suggest you check the readme in the source package before you begin. Of course, if you’ve never used the compiled binary versions of the editors, it will be even harder. Check my previous post for download links to the editors.

The Akarra shard hub, Akarra.net, hasn’t really gotten started yet, but according to rumours TbbW is working on the back-end, so hopefully it will be more useful “soon”. I suggest you check back there every once in a while if you’re into Whispers in Akarra.

Cheerio,

/jeb

]]>
http://www.oxeyegames.com/akarra-editors-source-code/feed/ 2
Whispers in Akarra, Server Source http://www.oxeyegames.com/whispers-in-akarra-server-source/ http://www.oxeyegames.com/whispers-in-akarra-server-source/#comments Tue, 19 Feb 2008 15:19:38 +0000 http://www.oxeyegames.com/whispers-in-akarra-server-source/ AleraAs I wrote earlier, Dawn of Daria and, in essence, Oxeye Game Studio have a past in an online role-playing game called Whispers in Akarra. The game was never completed – it barely reached alpha stage – but the editors and server were released to the public and a number of shards were started. Several years have passed since then, and I think it’s time to add the server’s source code to the list of available tools…


What is Whispers in Akarra?

Whispers in Akarra, or WiA for short, is a 2D online role-playing game in a persistent world, for Windows. The client uses Direct3D, DirectInput, DirectSound and DirectPlay (for network communcation). Since the game was developed in 2002, everything is DirectX version 8.

The server is hard-coded to support up to 128 client connections at the same time. This value is easily edited, but I haven’t tried the server’s performance with that many people. While the game was still active, the number of connected players peaked at around 100, and that seemed to work fine for most people.

Here are some screenshots from the game:

I don’t read books, give me the feature list!

  • 2D online RPG
  • Chat-friendly GUI
  • Combat, experience, levels, attribute points, abilities, skills etc
  • Items, horses, paper-dolling
  • Spells and item effects
  • Fellowships and guilds
  • Free PvP areas, guild wars, and PK rules for other areas
  • Overworld areas with day and night, and ever-dark caves
  • NPCs, shops, “item storage” and quests (including “Kill 10 rats”! Wicked!)

What resources are available?

Except the server source code, the following tools and applications are available:

  • The Akarra Client, required to play the game.
  • The Area Editor, used to create new maps and regions.
  • A number of Server Editors, used to create monsters, items, spells/effects, quests, skills and NPC chat scripts.
  • A tool to pack client graphics, called the “texture builder“.
  • A pre-built binary of the Akarra Server. This file also contains all the items, monsters, quests etc of the latest release of WiA.
  • And, of course, the Akarra Server Source.

Where can I get help?

Oh, that’s the catch! Not from me or Oxeye, that’s for sure. But there is a lot of information floating around, and an Akarra shard community is going to be organized around www.akarra.net. Until it has started for real, you can peek through a couple of threads in the old Oxeye forums:

In any case, I recommend you visist www.akarra.net for latest community views.

A final question… where’s the other source?

I may release the source code for the client and the tools later. First of all I want to see how much work it is for me to release the server, and what kind of reaction it gets. Secondly, the server source is the part of the code which is best organized. The client source is a mess (GUI code ftw), and the tools were developed with Borland C++ Builder. It was inexpensive and useful when I got it, but is no longer supported by Borland and probably difficult to come by these days. Even if I released the source for the tools, I’d recommend you to rewrite them from scratch in a more modern environment.

In any case, I hope you find the project entertaining or maybe educational. It was created with tears and blood, but also a lot of joy and extreme geekiness, and deserves a better place than on an old backup CD.

/jeb

]]>
http://www.oxeyegames.com/whispers-in-akarra-server-source/feed/ 20