Wednesday, December 4, 2013

game markup language experiment - Part 1

Going off my last post, where I described a theoretical game markup language, mixed with JavaScript and a type of CSS, I've decided to go ahead and perform a theoretical experiment.

You can follow my progress here: https://github.com/longjoel/gml-experiment

For a project base, I am using C# and .NET to primarily develop this in. Because this is going to involve a lot of dynamic language processing, and XML processing, it just makes sense to use this instead of C or C++.

Processing the DOM: 

* This is easy enough to do, because C# handily supports XML Serialization and deserialization.

Handling the Javascript: 

I am trying to decide between several projects at the moment for the JS implementation. 

* IronJS - based on ecma script 3, looks stable but no longer maintained.

* V8.NET - actively maintained, based on google's V8 javascript engine, should be robust and fast.

* Clearscript - looks ridiculously easy to get started with, can use chakra or v8 JS engines, actively developed


Handling the CSS:

CSS parsing will be a custom solution.

Display layer:

There are quite a few options available. There is DirectX with SlimDX. There is OpenGL via OpenTK. SDL 2.0 bindings exist as well, and that's all before we begin to look at MonoGame, XNA, or using Webkit. A decision on this does not have to be made right away. For now we can just use GDI + and a debug console.

Physics API:

Physics is another piece which will come further down the pipe. But will probably just use farseer for the time being. 



So the first step will be to gather all the necessary dependencies together in a folder of DLLs.

Part 2 will be designing the kernel.

Monday, December 2, 2013

Crazy thought of the day.

So I've been playing with a lot of JavaScript lately. Perhaps even too much. But sometimes, thinking too hard can lead to some interesting ideas.

JavaScript is designed primarily to manipulate the DOM of an HTML web page. JavaScript + HTML + CSS is a great combination.

* HTML describes the layout of the document.

* CSS defines the attributes of the elements in the HTML document

* JavaScript can be used to manipulate both the document layout and the elements themselves.


So why can't we treat games the same way that we treat HTML documents?

What if instead of describing elements of a web page, we were instead describing the play-field of a game?

HTML -> gamedoc:

<gamedoc>
<head>
<script source='level1.js'></script>
<script source='enemies.js'></script>
</head>
<level>
<entity class='spawn'  x = '0.0' y = '1.1'/>
<entity class='enemy' />
<brush>
____ <bpoint x = '0' y = '1'/>
____ <bpoint x = '0' y = '1'/>
____ <bpoint x = '0' y = '1'/>
</brush>
</level>
</gamedoc>

CSS -> GSS:

brush{
____ texture:url(img/background.png);
____ visability:visible;
}

JavaScript:

$(gamedoc).onready( function () {

____ $('entity').think( function(t){
____ ____ $(this).x = $(this).x + $(this).vx * t;
____ });

});

So, I'm not super clever, but I think that if I were working on a game engine, I would rather have something declarative like this to work on, instead of something like Unity3d. But maybe i'm just weird like that.


Saturday, November 30, 2013

Javascript is the new BASIC. And that's not necessarily a bad thing.

I think I come from the last generation of programmers that grew up learning a BASIC dialect as our first programming language. Then came Java, then Python, then C#, and now Javascript.

I grew up with Qbasic 1.1 on MS-Dos 5, chugging along on my dad's old 386sx. We didn't even have a floating point co-processor. But coding on that thing was so much fun. I made my own sprite editor, a hand full of games, and got it to do some of my math home work for me. I can even go back today, and with a little bit of reflection, do some wizardry again in that ancient old programming language. Probably the best part about programming in QBasic was that a good chunk of this was before the internet. I actually had to go to the library and check out an ancient programming manual, then figure out how to adapt it to QBasic. This was fun.

So now here I am, 20 years later. (Have I really been doing this for 20 years?) I develop .NET all day working on a CRM system. Programming hasn't really been much fun. It's been quite productive, that's for sure, but not much fun. Then I decided to put together my Romflow application. This isn't the first time I've tried to make an emulation frontend, but this is probably my best effort to date. In looking at the other options available, I wanted to make something fast, something customizable, and something easy. So instead of doing a plugin system using C# interfaces, or hardcoding something using System.Drawing, I decided to look into using a web control hosted application. And you know what? It works really really well.

Kind of. You see, I'm not very good with the HTMLs and the CSS and the Javascript. Since I graduated from QBasic, I've stuck exclusively with statically typed languages. I liked the predictability and stability, and the ease of debugging that statically typed languages had to offer. However, at least not right away, this is not really an option for working with romflow. While it's possible to design a silverlight application, or a flash application, or a dart application, it's actually just much simpler to write something in Javascript.

Even though it's simpler, it's still not all that simple. You have to remember, we are doing things to HTML that it was never intended to be doing. HTML was meant to be a document, not an application framework. Never the less though, here we are. The biggest challenge for me is working with CSS though, not even Javascript. CSS feels like the rules are made up as you go along. Especially when it comes to vertically aligning content.

Despite having stack exchange, countless forums, and numerous other resources, making a good looking web app is still a gigantic challenge. Especially if you are invoking the dreaded window.external API. But, when I actually got something working the way I wanted it to work, I was 8 again, hacking away on my dad's dying PC. Hours started to go by as every minute, my app worked a little better, and a little better still. I no longer see an empty HTML page as a portal to evil, but rather as a canvas to paint my ideas upon. Javascript is fun. And fun isn't something I've had with programming for quite a while. It's challenging as well.

Wednesday, October 9, 2013

Blogging is hard and stuff.

Blogging is hard. I'm still not even sure why I really try, but it really is damn hard for me to not want to obliterate my blog every few months, make a new one, then delete that one again after only making a post or two. So now I'm making it my mission to try and update at least once a week, whether I have something to write or not.

So, what have I been up to lately?

I'm trying to get myself off of Windows. Not that there is anything wrong with windows, it's just that Linux is a lot more fun. Now that steam is a viable product, and now a certain horrible hardware company's drivers are usable, there is nothing that I can do on my laptop under Linux, that I can't do under windows.

I'm also trying to teach myself Python as well. Python is a great language that gets a lot of flack for being slow. I don't care how fast it is as long as it's fast enough. For everything short of AAA game development, it's more than plenty fast.

During the day, I write C# code. All day long, it's C#, and Winforms, and SQL, and so on. I feel there is a certain advantage in separating one's work experience from their home experience. This is hard because I actually enjoy coding in C# a great deal.

But there is this certain grand elegance when coding with python. Style is something setup for you using PEP-8. There is a python library for nearly everything, and it excels on low end hardware like the raspberry pi. What really spurred me on to learn it was pycharm having a free community edition.

Still not exactly sure what I want to do with python yet, but I will post if I come up with something cool. Maybe a port or an adaption of romflow?

Saturday, May 11, 2013

Romulator Lightboxing

Lightboxing. It will look better when the theme is up and running.




Thursday, May 9, 2013

Tuesday, May 7, 2013

Instead of deleting all the posts and starting a new blog from scratch again...

I'm just going to keep updating this one!

Right now I'm working on a emulator front-end using HTML5 as the theeming engine. Works a lot better than I thought. Right now the large part of the work remaining is coming up with a killer theme that plays nice with the game-pad interface I've set up. At some point, I should diagram all this out.