• Register

Rogue Reborn is a modern port of Rainbow Six: Rogue Spear. The primary focus of this project is to incorporate all the elements of the original R6RS while upgrading and providing new features without drastically altering the core game-play.

Post news Report RSS Rogue Reborn: Technology Demo (Google's V8 and GUI/Game Scripting)

Shouldn't scripting/GUI-editing be easy? We want people to mod when Rogue Reborn is released. Here is what we are doing to make that process easy.

Posted by on


JavaScript

It's a language that has grown too fast for its own implementation, but it still has this appeal of usefulness to it. It's super dynamic, easy to use, and is one of the few languages that are better suited for library development (e.g. jQuery, node.js, etc) It's just useful when put it in the right hands.

So, we figured our JavaScript guru would enjoy having this in his hands. We collaborated and decided to utilize Google's open-source JavaScript engine: v8 and embed it into our engine.

Quick History Lesson, id Tech 3

We decided to take a leap of faith and use an incomplete engine developed by Robert Beckebans team. There was a ton of work still left to do, but we figured it would be a great starting ground. The engine is based off of id Tech 3 and with that came some some horribly written code (which is no offense to idSoftware) along with no scripting and a compiled GUI.

What we did

We ripped all of the GUI code out and when we say rip, we meant deleted. We needed a clean slate to work from. This presented a few challenges though. We wanted to implement v8 because we knew it was fast due to its VM and, also, because we really believe JavaScript would give us everything we needed and more.

There is little documentation on v8. It's mostly just reading source code and getting a feel for the library. That's why we haven't updated in the last two weeks. However, once we got the hang of it, everything became smooth sailing. So, instead of typing more, we're just going to give a video demonstration and talk on the implementation and how it is used.

The Talk and Demonstration

The first half of the video is the technical aspects of the implementation. Skip to 4:00 to see a GUI written.


A 2-minute introduction to GUI-editing in Rogue Reborn

Every object that we expose to JavaScript has an equal class representation in the source code.

So, some examples (shown in the video)

gui.StaticImage() is represented by class Static_image : public Element
gui.MoveableImage() -> class Moveable_image : public Static_image, Moveable
gui.print() -> method print on class Gui

And so forth.

Every object is wrapped and allocations are handled internally. Once the GUI ends or a new GUI is loaded, then it's all cleaned up and a new gui can be allocated. The user never interacts with any of that. They can add elements from both the code or JavaScript and not worry about one interfering with the other. You can expose objects at any time.

We really hope this will be used and improve GUI/general-scripting for the (hopeful) modding of Rogue Reborn.

Example Weapon Script (MP5K-PDW)

Here is an example of the implementation of the MP5K-PDW. This should look familiar to the RS-Editor!

var mp5k = new weapon.Weapon("MP5K-PDW", {
	model: 'models/weapons/mp5k-pdw',
	accuracy: {
		stopped: 1.26
		shuffle: 1.75
		walk: 5.16
		run: 7.59,
		walk_fast: 7.59,
		run: 13.44,
		crouch: 0.70,
	},
	attributes: {
		zoom: [2.00],
		reticule: 'textures/reticule/mp5k.tga'
		reticule_time: 0.76,
		muzzle_flash: 0.09,
		muzzle_velocity: 375,
		encumbrance: 2.78
	},
	flags: [weapon.SAFETY, weapon.SINGLE_SHOT, weapon.FULL_AUTO],
	ammo: {
		type: weapon.9MM_FMJ,
		rounds: 30,
		rate: 900,
		magazine_switch_time: 2.5
	},
	sounds: {
		single_shot: 'sounds/weapons/mp5k-pdw/single.ogg',
		three_shot: 'sounds/weapons/mp5k-pdw/three.ogg',
		burst_shot: 'sounds/weapons/mp5k-pdw/burst.ogg',
		end_shot: 'sounds/weapons/mp5k-pdw/end.ogg',
		magazine_change: 'sounds/weapons/mp5k-pdw/magazine.ogg',
		shell_clink: 'sounds/weapons/mp5k-pdw/shell.ogg',
	}
});

mp5k.fire = function (owner, going_to_hit) {
	if (going_to_hit.team == owner.team) {
		this.lower();
		return false;
	}
}

Enjoy "technical" updates?

Twitter is probably the better bet for keeping track of those. We rather not bore the rest of community with them (unless they're really neat or cumulative)

Twitter.com

Enjoy.

Post comment Comments
NoobSaibot
NoobSaibot

Not really my cup of tea for an update, but it's nice to know that things are going well.

Reply Good karma Bad karma+2 votes
justinvh Author
justinvh

Yeah, it's a technical update. Can't always appeal to everyone :)

Reply Good karma+2 votes
Dotmister
Dotmister

I found it very interesting - thanks!

I tried implementing V8 into a project I was working on before realising it was limited to Windows (at the time).

Will you be doing more of these technical updates? I like to see how other projects handle problems they encounter

Reply Good karma Bad karma+1 vote
justinvh Author
justinvh

Yeah, for sure. It's not always about models, maps, and guns.
We'll post update about anything that we are proud of... regardless of context.

Reply Good karma+1 vote
Cypher05
Cypher05

I loved this update, made me want to check out moddb more often considering I'm 2 days late. I wouldn't mind more updates like this (and like Dotmister suggested).

Reply Good karma Bad karma+1 vote
justinvh Author
justinvh

2 found it interesting, the other 160+ basically said, "Uh, huh."

I'd give tech talks all day if I could. I may do one more video demonstrating the ease of interfacing everything together.

Reply Good karma+1 vote
simulacra
simulacra

Will you be implementing multiplayer into Rogue? How do you plan on making game lobbies etc. or will you have support for gamespy or some other lobby system? I've played this game since it came out, off and on. I guess you can call me an expert (hah). Multiplayer is the most important part of the game as I'm sure you know. I'm very excited you're doing this... I just suggest that if you're working on single player to just scrap that and focus solely on mp since that's how everyone will be playing it. I'm sure rogue elitists will whine and moan if things aren't exactly like the original, but that can't be avoided. I think if you can make improvements, do it. As long as the gameplay and action is the same, people will love it. That's what made this game so great in the first place.

Reply Good karma Bad karma+1 vote
justinvh Author
justinvh

We have a guy from SIXPAG that keeps us in check in this department. Single player is not our primary focus and we've mentioned that before, but we do understand that there was a certain demand for customizing, mods, and etc that Rogue Spear never had.

Multiplayer is the most important aspect and we just so happen to agree.

Reply Good karma+1 vote
twd.nutta
twd.nutta

its about time this great game was remade! i grew up with this game and still love it like many others!
thank you thank you thank you!
Xorse is king!
where the forums at? is it going on steam?
so many questions...!
keeping f1?
great job with kh... perfect!!!

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: