Skip to main content

News

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 - Rahkiin

151
Site Comments / Re: The Wiki
Not as a tutorial, but for making the wiki more complete, I might work on http://wiki.spheredev.org/Developing_a_Sphere-compatible_engine while I am working on my runtime.

I could also add a theoretical tutorial on my obstruction and animation system and on my portal system, to give the more advanced devvers some ideas for their games.

// Rahkiin
152
Hellos and Byes / I say Hello, you say...
Hi guys!

I would like to use this opportunity... oh lets cut the formal crap: I am Rahkiin! A 19y old CS student from Delft, The Netherlands.

Then
I came to know Sphere when I had an game-dev assignment in my last year of high school. With three other guys, I made a game I was, and still am, very proud of. For future reference: the game was called Scala World, and was all in dutch. Although we did not know Sphere at all, we were very able to use the Sphere Editor and as I am quite good in programming, I picked up the JavaScript library pretty quick.
We used the map engine for the Pokemon-styled (literally, we used their tileset) game and programatically I added some nice tools, that are worth explaining, I think :)

Obstruction and animation
The roles in my group were divided perfectly: I was the programmer, one mate made the story and quests, another made spritesets and the fourth made the maps. Now I wanted to make the programmer able to do very easy obstruction mapping (non enterable blocks because a bench is there, but also doors you can only walk into (one-direction obstruction) and animation placing (eg, when jumping a ridge). To do this, I added two invisible layers to the map and obstruction tiles to my tileset, and I programmed the tile-based 4-way single-step (like Pokemon) movement with the obstruction layer as obstruction logic. And it worked very well! The map-designer could now create the maps all himself.

I also used the obstruction tiles for random person movement (NPCs). It is much faster than obstruction-segment collision matching.

I did use Map Zones, but just for Quest activation.

Portals
Our game would cover the whole building of my school, with every room in it. Most class rooms would just contain some walking students and the teacher assigned to that room/course.
Other classrooms would contain a teacher giving quests, in turn giving either keys or other objects. (The ultimate goal was to obtain the 3 elemental keys, open a dungeon and beat the boss (the master school bully) by answering questions about your adventures in the school).

This all meant we would have a lot of portals between rooms. And I did not want to program each of them by hand. So I created a portal system: blue and orange portals. A door entity placed where the doors are and upon collision, the player is moved to the linked door, in the right map, standing in the right direction. The portals were linked automatically: the portal in the corridor did not need to know the location of its opposing portal. Instead, they just both gave a link-name and a direction the player should be facing when returning. A script opened all maps and looked for all portals. A slow process, but with a portal-cachefile this was only done when changing any portals.
Result of all this in combination with a persistence script I found on the wiki: maps can be linked by placing entities and a small line in the entities touch-code: Portal('PortalName','east'). Even my map-designer could handle that!

I might upload the code somewhere, but I learned much last years and it ain't very clean code anymore (deadlines and all that).

Now
My current activities with sphere are somewhat different from writing a game. I am actually writing a Sphere Runtime for Mac OSX. (I am very Mac-ish these days, although I do have a gaming computer somewhere). I also went to write a native OSX Sphere DevKit, but this is on hold until I have my runtime (I tend to overcomplicate things, so I started with a full plugin-based environment. I think you guys know what I mean :P).

I want my runtime to have a couple of new features and functionalities. But in the end, I also want to be compatible with existing games.


  • UI and input: Cocoa

  • Joystick input: IOKit

  • Graphics: CoreGraphics. However, if this utterly fails I might do OGL (I suck at OGL)

  • Audio: CoreAudio

  • JavaScript: JavaScriptCore (WebKit)

  • Bonjour: LAN game discovery



If you are anything into OSX and iOS dev, you might notice these are all available on OSX natively, including JSC (since 10.9). That is great; what's also great is that even JSC is available on iOS7, so I could 'port' the runtime to iOS. And I think I could even convince Apple to put it in the App Store, because it is JavaScript and a Zip of resource files for a game, not some native code downloaded from the internet...  :D

Also, even though I wrote JavaScriptCore there, I have been writing an Objective-C wrapper very much alike JavaScriptCore for V8 (Flying Jester: I used the new Handle code  ;)), called L8. I do not trust it memory-wise though. And there is a problem is converting the C blocks to functions, and around. Quite a piece of code. So I resigned to JSC. (When I started this project, OSX 10.9 was not released yet).

That aside. The features:

All new class-based Sphere library
(With ECMAScript 1.6 (JS6) in mind, modules yeah!). This means a lot of 'classes', and no more function such as LoadFont(): instead there is the new Font() (create font) and new Font('font.rfn'). This is a lot nicer for me because of the JS-ObjC mapping done by JSC/L8.

Sphere compatibility with a Shim
Of course it should have everything Sphere has, but mostly via a shim.

Game libraries
I want to design the concept of a library for Sphere. Especially with the JavaScript modules (ES6) in mind. Any thoughts or comments are welcome. I think it would clean up a game, especially when using big libraries like Radlib. I am thinking about a folder with an extension (OSX-like), not zipped, but placed in a libraries folder. Then lib-files and your own files will not be mixed.

Native OSX game packages
This I find very awesome: I want to pack the runtime in an .app package and load the game into it. Then add some much more info to the game information file (actually, get rid of .sgm and make some .plist) to also include game icon and such. Then there is this simple .app package, such as Blockmap.app with the Blockmap icon, and double-clicking it opens the game directly. Save-files are stored in the user-data location and the app actually shows up with the correct icon in the dock. I would really prefer such package over sending someone a Zip with a bunch of files in it :)
I have no Idea how easy, hard or impossible such thing is for Windows people. (Exe can contain resources though).

My plans
As I said above, I am planning on making the dev environment. Just because I think Sphere is very awesome! I also plan to hang out on these forums.

As far as I can tell, I am speaking to just a couple of people here: Radnen, Flying Jester, NEO, Mooch, DaVince and Lord English. And Harry Bo. But that's cool :)
Please, do not tell me I waste my time here. Don't we all? ;D

So that is me, what i've done, what I do and what I plan to do with sphere. Any comments and ideas are welcome!


// Rahkiin