Jump to content

  • Log In with Google      Sign In   
  • Create Account

Wilhelm's Journal

Compiling java games to javascript

Posted by , 05 December 2015 - - - - - - · 1,019 views
java, javascript, opengl, webgl and 1 more...

Hi.

 

Ive been very busy with my main project (Legends of Strife) Its pretty much ready for an fully playable release. There is still only one zone but it has about 60 quests and 20 spells/abilities and a decent amount of frendly and hostile npc's with unique behavior and lots of items/stats and a working "town siege" system but il save that for another post in the hopefully near future.

 

I decided to take a little break from that so for the last three weeks I've been playing with a library called TeaVM. It allows java classes to be converted into javascript to run directly in the browser. As far as I understand there are other projects that aim to do the same but before now I never thought it possible ^^. So I took the time to create a javascript implementation of my engines "system interface". basically swapping openGL calls for webGL and instead of loading files from disk downloading them through the browser etc.

 

I then went ahead and compiled one of the smaller games i made a few years ago and it works very well. For me this is amazing. I used to have a website hosting of couple of games that i created in java + opengl using my engine. But they all ran as java applets wich is basicly blocked everywhere now. Chrome fully blocks java applets regardless of security setting as of about two months ago and other browsers make it so hard it might as well be fully blocked. But even when java applets were still feasible they were annoying since the users had to have java (and a new enough version of java) installed. It also even back then came up with threatening security warnings that detered users and anyone with slightly higher than "normal" security settings could not run it. Making sure the applet ran in linux or mac also needed quite a bit of effort.

 

Now i can host those games again and have them run in the browser with no security warnings, no plugins and less cross platform issues (Only tested it on windows and linux using chrome though).No changes were needed to the actual game to have it run in the browser. So the exact same game code runs as a desktop app as well as in the browser.

 

There is one big downside though. It is quite a bit slower. But since its small games thats hardware rendered it doesnt matter too much. And i expect it to only get better with time.

 

One other drawback is that TeaVM doesnt support reflection. and probably never will based on the fact that it only compiles methods that can possibly execute though static linking. Wich once again for smaller scale projects should be no problem. I had to do a little refactoring on my engine to get rid of one or 2 instances of reflection but that wasnt too much of a problem. On the other hand this makes compiling really fast and the output javascript as small as possible.

 

Lastly I found that TeaVM failed to compile some deeply nested loop structures with labelled break or continue statements so I had to do a little more reworking in that regard. But i hope future versions will address that. Its only at version 0.4.0 and seems to be under active development.

 

I hosted the game here. http://www.distantmelody.net/spheres-of-madness/

 

I plan on soon putting up my other small games as well Posted Image




Strife update

Posted by , in Strife 12 January 2015 - - - - - - · 1,042 views
Strife, Legends of Strife, MMORPG and 1 more...
Legends of Strife

I realized that i haven't made and update in 7 months. Fortunately its not for lack of progress I somehow just never got to writing posts. So here's a quick summary, in the last 7 months I have:
  • Separated the opengl part of my engine from the rest via an interface and with that created a DirectX equivalent. Since I'm using java I had to create my own directx bindings in C++ and link it in using java's native interface. All of that was a surprisingly large amount of work especially considering that before I started I had no experience with either C++ or directx (or java's native interface for that matter). Soon I want to add an android opengles equivalent as well ^^
  • Significantly improved the AI system and made it easier to quickly define an NPC's behaviour and abilities.
  • Server and client now reads all Quest, Entity and Item information from XML. If you're interested here's the current Entity XML file. For two good monster examples check the ForestBoar and the AntleWorker. For two town npc examples check Valice and Auburn. http://distantmelody.net/journal/2015-01-12/entity.xml
  • Added various spells that can be used by the different player classes and/or npc's and lots of other things (Npc's, Terrain, Terrain Objects, quests, items etc etc.)
Here's a small montage we've made demonstrating some of the new (and some old) spells and abilities followed by some screenshots. For a more detailed breakdown of the new content visit our our other blog on indiedb (link at the bottom).



Posted Image

Posted Image

Posted Image

Posted Image


Strife: Sigil System

Posted by , in Strife 12 June 2014 - - - - - - · 657 views
Strife, Legends of Strife, MMORPG and 1 more...
Legends of Strife

Implemented sigil system. You can now buy premade sigils or design and upload your own which can be displayed on your armour for all to see.

Heres a video explaining it in more detail.



Posted Image


Strife: Bitcoin to ingame cosmetic currency

Posted by , in Strife 14 March 2014 - - - - - - · 809 views
Strife, Legends of Strife, MMORPG and 1 more...
Legends of Strife

Implemented the purchase of ingame cosmetic currency (star shards) using bitcoin. Each strife account gets an unique public address to which the player can make payments. If the player is ingame it should take a minute or two for the server to pick up the payment and give the player his star shards. If the player is offline the server will pick up the payment the next time the player logs in. Star shards unlike the normal ingame currency (copper, silver and gold) is shared between all characters on the players account. Star shards will be used to buy various cosmetical things for your characters but in now way will it make them stronger.

As is shown in the below screenshot the player can either copy the bitcoin address from ingame and paste it into his bitcoin client or use a cellphone wallet and scan the QR code.

Posted Image

Your star shards is displayed under your normal currency in the inventory screen.

Posted Image

Other than that I have a couple of screenshots showing some of the recent work done on the terrain. Thnx for reading!

Posted Image
Posted Image
Posted Image
Posted Image

Posted Image


Strife: World Editor

Posted by , in Strife 05 March 2014 - - - - - - · 935 views
Strife, Legends of Strife, MMORPG and 1 more...
Legends of Strife

Done a lot of work on the strife world editor. It has reached the point where all world building can be done inside the editor without using Photoshop or a text editor to edit certain aspects of the world.

Here's a short video briefly demonstrating the work done on the editor. Expect much terrain improvement coming soon! My wife has done (and will be doing) all the world building using the editor. I am now going to shift my focus back to game client and server programming.



btw. My wife writes a lot more detailed posts on Legends of Strife over on indiedb (with allot more screenshots). I tend to only state the biggest technical points.
Posted Image


Strife: Stat System

Posted by , in Strife 06 January 2014 - - - - - - · 1,283 views
Strife, Legends of Strife, MMORPG and 1 more...
Implemented Stats.

Way too lazy to type out a proper explanation now but please feel free to ask questions!

Here's a demonstration video



Posted Image




Strife: Reputation System

Posted by , in Strife 27 November 2013 - - - - - - · 975 views
Strife, Legends of Strife, MMORPG and 1 more...
Legends of Strife
  • Completed the reputation system.
Posted Image

The main feature of strife will be the world pvp. If a zone in strife is contested between 2 factions players will be able to choose sides and kill oposing players and npc's in that zone as a means to gain reputation with their faction. Gaining reputation with the various factions of the world is the main way (or first step) to unlock the best gear in the game.

Eventualy there will be 2 main factions in the world. and most of the world will be the battleground (global conflict). There will be lots of smaller conflicts between smaller factions that only exist in their zones (local conflict). There are also zones with only 1 faction in it and there will be zones with none. You can freely kill anyone or anything but killing youre ally in a contested zone will give you a massive reputation penalty with youre faction in that zone (Except if it was in self defense). Kill a couple of allies and youre reputation will soon drop below 0 and youl find yourself at odds with both factions in that zone. A zone with only one faction (Neutral Zone) generaly disgourages pvp since there are no enemies and killing another player will have the same effect as killing a ally in a contested zone. A Zone with no factions in it is a free for all since theres no factions no reputation gains/losses will occur for killing other players. Even if you and another player is allies with regards to the global conflict you become enemies the moment you step foot into a zone contested by other factions if your on opposing sides in that local conflict.

Most towns (especially those that belong to either of the two main factions) will be destroy able. Once a town is destroyed all quests, vendors and whatever else in that town will be lost to the other faction untill the town gets automaticaly rebuild a couple of hours later. So if you were questing in the area... Tough luck! go find someplace else to quest and defend you're town better next time! NO Im NOT going to make it instanced!!! anyway. heres how it should work in a little more detail. A group of players decide to attack an opposing town. When enough enemy players entered the town or imediate surroundings the server will register it as an "town siege event". (In other words a lone player or small group just trying to mess with with the players in the town from the outskirts will not count as an "town siege event") From this point onwards any player (attacking or defending) that dies within the towns limit will not be able to re enter the town for the duration of the town siege. (or at least they can try but theyl get a 'Lingering Death' debuf that will kill them in seconds if they get too close). This way a town siege cant continue indefenetly. Of course more fresh attackers or defenders can enter the town while the siege is on but eventualy all the attackers or defends would have died (or fled) and the siege will be over. If all attackers within town limits are dead the town was successfully defended. All the players that helped defend the town (even the ones that died) gets a once of reputation and maybe gold reward. Attacking players get nothing. Should all defending players and defedning npc's die during the townsiege the town gets destroyed (basically all building just gets replaced with rubble after maybe spontaneously combusting). All the players that helped attack the town (even the ones that died) gets a once of reputation and maybe gold reward. The defending players get nothing and their town is unavailable to them for a while.

Eventually bigger towns/cities might get defensive structures that makes defending them easier but could be destroyed during the town siege

When you create a new character you are not affiliated with any faction but you'd probably want to join one of the 2 main factions sooner rather than later.

All the above mentioned reputation mechanics are implemented but these 2 main factions with their destructable towns dont exist ingame yet. I have created a much smaller scale conflict in the starting area of Elclease. Elclease itself is a neutral zone for the faction 'Summerwind Village' (starting town) but within elclease there is a small conflict sub zone between 2 rival farmers. You have to choose sides between them and follow the quest chain from the one you choose. The quests generaly involve sabotaging the other farmers land and while doing so youl run into the players that sided with the other farmer (and killing them will help you unlock certian reputation rewards). the farms have other npc's on it like farm hands and guard dogs that will attack oposing players and defend players that sided with their farm. This small conflict zone and quest chain set will serve as an introduction to pvp in Legends of Strife.

Heres a small demonstration video. Me and another player starts in the general area of Elclease (Im a Mage, Other player is a Necromancer with 2 minions). Here we have a neutral standing towards each other (you can see that from the portrait colour). If we kill each other at this point the killer will suffer a significant rep penalty with Summerwind Village. We then run to one of the conflicted subzones and youl notice that the necromancers portrait turns red indicating that were enemies in this zone. The necromancer starts attacking me. Youl notice that the nearby gaurd dog assists me because were fighting on the farm that belongs to the farmer that I allied with. I for the most part run around looking for more frendly npc's to asist me since necromancers are currently pretty unbeatable ^^.



Posted Image


Strife: Character screen additions and more inanimate entities

Posted by , in Strife 23 October 2013 - - - - - - · 819 views
Strife, Legends of Strife, MMORPG and 1 more...
Legends of Strife
  • Characters now display on the character and character create screens.
  • you can now choose hair style and colour on character create screen.
  • Added more inanimate entities with unique on use actions to the world.
  • Added looting animation.
Here's a video showing the improvements to the character and character create screens.



Here's a video showing Lamp posts (Inanimate Entity) that for some reason offends the nearby turtles.



Posted Image


Strife: Npc Behavior

Posted by , in Strife 30 September 2013 - - - - - - · 766 views
Strife, Legends of Strife, MMORPG and 1 more...
Legends of Strife
  • Implemented a flexible npc behaviour system that can be used to define reusable behaviour components. Multiple behaviour components can be given to one npc.
  • expanded quest system to also allow for custom quest specific objective types (As opposed to just the generic kill X of creature or collect X).
  • Added spell Bone Cage: Bones pierce out of the ground and encase the target immobilizing it for 4 seconds. Necromancers gain Bone Cage on level 3.
  • Added a rudimentary background to speech bubbles.
  • Implemented inanimate entities. (Non moving interactable and/or lootable objects for example chests, herbs).
Here's a video of an escort quest that demonstrates most of the progress made.



Here's a video demonstrating inanimate entities



I've taken the online test server offline for now. I got some valuable feedback from it but for the time being I want to fully focus on development again.

Posted Image


Strife: Quest Log

Posted by , in Strife 30 July 2013 - - - - - - · 499 views
Strife, Legends of Strife, MMORPG and 1 more...
- Implemented quest log. You can now view over all your active quests. Also added the functionality to abandon quests.
- Tweaked the cell shading to make it more apparent.

You can download legends of strife here http://www.distantmelody.net/data/legends-of-strife/strife.exe. Or you can run an older version and it should update itself.

Here's a video to demonstrate.



Posted Image






December 2016 »

S M T W T F S
    123
4 5678910
11121314151617
18192021222324
25262728293031

Recent Entries

Recent Comments