Browser Based MMORG using Impact Please help :)
-
ShawnSwander
- Posts: 53
- Joined: Thu May 17, 2012 12:31 am
Browser Based MMORG using Impact Please help :)
I'm throwing my issues up as I hit them so skip to the bottom if you wana help me with what im working on now.
NOTE: This issue is solved using code I post below. But I'm leaving it up in case someone has a similar problem.
So I was able to get through Hallsofvalhalla's tutorial on making an mmorpg in socket.io node.js and impact and learn a few things and frankly I still don't understand everything in there but I figured I'd just jump in and crash and burn myself.
I enjoyed using the impact engine but the way it's designed might be causing me some problems with movement.
I want a 7x7 board always on the screen with the player in the middle square. Impact seems to prefer smooth movement type moves. So if my tiles are 55x55 I only want players to move incriments of 55px (1 tile)
I think I can figure this out but I just kinda wana see if anyone has some ideas I might wana use.
So far here is what I tried for a keypress telling the player to move west.
if( ig.input.state('west')) {
this.pos.x = this.pos.x - 55;
}
each direction has the equivalent code changed for its direction...
I wanted to just move 1 square (55pixels) the problem with this is that it just shoots you off the map. I think I need to just tell it to stop after each input.
I was able to add an if statement and an incriment to limit the move to 1 tile but I want to understand why it moves this way.
NOTE: This issue is solved using code I post below. But I'm leaving it up in case someone has a similar problem.
So I was able to get through Hallsofvalhalla's tutorial on making an mmorpg in socket.io node.js and impact and learn a few things and frankly I still don't understand everything in there but I figured I'd just jump in and crash and burn myself.
I enjoyed using the impact engine but the way it's designed might be causing me some problems with movement.
I want a 7x7 board always on the screen with the player in the middle square. Impact seems to prefer smooth movement type moves. So if my tiles are 55x55 I only want players to move incriments of 55px (1 tile)
I think I can figure this out but I just kinda wana see if anyone has some ideas I might wana use.
So far here is what I tried for a keypress telling the player to move west.
if( ig.input.state('west')) {
this.pos.x = this.pos.x - 55;
}
each direction has the equivalent code changed for its direction...
I wanted to just move 1 square (55pixels) the problem with this is that it just shoots you off the map. I think I need to just tell it to stop after each input.
I was able to add an if statement and an incriment to limit the move to 1 tile but I want to understand why it moves this way.
Last edited by ShawnSwander on Thu May 31, 2012 5:30 pm, edited 3 times in total.
Re: Browser Based MMORG using Impact Please help :)
did you make the map with the weltmeister editor? Then just add collision tiles on the map borders and if the player entity have the collides entity something like:
Code: Select all
collides: ig.Entity.COLLIDES.PASSIVEOrgullo Catracho
-
ShawnSwander
- Posts: 53
- Joined: Thu May 17, 2012 12:31 am
Re: Browser Based MMORG using Impact Please help :)
I got it to work with this type of statement.
This represents 1 square of movement. Here is a screen shot to show what I'm doing better.

The rocks in the water are collision tiles. The code above works but I'd like to add a delay after each move to make the game seem more turn based though you don't have to take turns and everyone doesn't finish at the same time. So you move wait 3 seconds and you can act again. I'm guessing this won't be hard with timers. What might be hard is I want the mouse to control what moves you take and I want you to be able to move 3 squares per turn.
My idea is to find where the user clicks and form a path to that square that goes around collision tiles. I think I can do this but my wife only lets me code so much before I pay for it
On the timing thing...
Am I going to have to do that server side to prevent cheating?
Timers in impact seem to be based on frames so if the user isn't rendering quickly won't this cause problems?
Code: Select all
if( ig.input.state('west')){
//check if hex is moveable
var res = ig.game.collisionMap.trace( this.pos.x, this.pos.y, -55, 0, 1, 1);
if ( res.collision.x == false && res.collision.y == false){
if (movenumber < 1){
this.pos.x = this.pos.x - 55;
movenumber = movenumber+1;
}
}
} 
The rocks in the water are collision tiles. The code above works but I'd like to add a delay after each move to make the game seem more turn based though you don't have to take turns and everyone doesn't finish at the same time. So you move wait 3 seconds and you can act again. I'm guessing this won't be hard with timers. What might be hard is I want the mouse to control what moves you take and I want you to be able to move 3 squares per turn.
My idea is to find where the user clicks and form a path to that square that goes around collision tiles. I think I can do this but my wife only lets me code so much before I pay for it
On the timing thing...
Am I going to have to do that server side to prevent cheating?
Timers in impact seem to be based on frames so if the user isn't rendering quickly won't this cause problems?
Last edited by ShawnSwander on Mon May 28, 2012 11:47 pm, edited 2 times in total.
-
ShawnSwander
- Posts: 53
- Joined: Thu May 17, 2012 12:31 am
Re: Browser Based MMORG using Impact Please help :)
I don't think I described it well. the code I posted solves it but simply adding borders would just have pinned the character to the borders, it would take away the user's ability to move a specific distance.Ark wrote:did you make the map with the weltmeister editor? Then just add collision tiles on the map borders and if the player entity have the collides entity something like:Code: Select all
collides: ig.Entity.COLLIDES.PASSIVE
-
ShawnSwander
- Posts: 53
- Joined: Thu May 17, 2012 12:31 am
Re: Browser Based MMORG using Impact Please help :)
A more challenging issue for me that I have no idea how to tackle is
How to get walls to line up like this... Impacts map engine doesn't allow offsets and I can't put 100 pixel tiles on overlapping like I need to do this. Anyone have a better method? Eventually I want some walls to be breakable by magic spells.

Here is a quick gimp image I threw together on how I want the images to look.
Just more info each wall will take up exactly one square.
So my thoughts are that I can make entities for walls this allows me to make them easy to bread down and allows me some freedom on where they spawn. If anyone has a good method I could use to spawn these entities I would love to hear it.
How to get walls to line up like this... Impacts map engine doesn't allow offsets and I can't put 100 pixel tiles on overlapping like I need to do this. Anyone have a better method? Eventually I want some walls to be breakable by magic spells.

Here is a quick gimp image I threw together on how I want the images to look.
Just more info each wall will take up exactly one square.
So my thoughts are that I can make entities for walls this allows me to make them easy to bread down and allows me some freedom on where they spawn. If anyone has a good method I could use to spawn these entities I would love to hear it.
Re: Browser Based MMORG using Impact Please help :)
Uhmm I don't think that the player's fps would affect the timer. For the wall, yeah make it an entity for it to be breakable with spells ^^
Also what do you mean by the impact engine not allowing offset? Is it the weltmeister editor? Or the entity offset property?
Also what do you mean by the impact engine not allowing offset? Is it the weltmeister editor? Or the entity offset property?
Orgullo Catracho
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Browser Based MMORG using Impact Please help :)
Weltmeister is pretty much set up to be a tile engine as far as I know. It expects all the tiles to be square, or at least rectangular. You may have to do some finessing to get this to work. You could cut up your isometric elements into squares and basically fake the isometric viewpoint. You may want to build up a game level using layers in Photoshop or GIMP and then slice it into equal squares until you get the hang of how to slice them appropriately. After a while you probably won't need to do that, although you may find it easier to simply build the level in an image manipulation program, and then simply slice and reassemble in Weltmeister. Then you should be able to use all of the angular default collision tiles to properly set up a collision map for the stage, or you could even make your own based on your base images in Photoshop or GIMP to make them perfect.
And while it is another piece of commercial software you may not want to buy, if you are wanting to make an HTML5 isometric MMORPG, The Isogenic Engine may be exactly right for you. The "Online Edition" is specifically made for isometric HTML5 MMORPGs backed by Node.js.
And while it is another piece of commercial software you may not want to buy, if you are wanting to make an HTML5 isometric MMORPG, The Isogenic Engine may be exactly right for you. The "Online Edition" is specifically made for isometric HTML5 MMORPGs backed by Node.js.
The indelible lord of tl;dr
-
ShawnSwander
- Posts: 53
- Joined: Thu May 17, 2012 12:31 am
Re: Browser Based MMORG using Impact Please help :)
@ Ark
...WM allows entities to overlap but it takes forever to populate them that way. I'd have to hard code it. So I feel like my best option is an array with all my walls that spawns walls as entities in a for loop for each level.
@Jackolantern
I meant weltmeister thanks for correctingArk wrote:Uhmm I don't think that the player's fps would affect the timer. For the wall, yeah make it an entity for it to be breakable with spells ^^
Also what do you mean by the impact engine not allowing offset? Is it the weltmeister editor? Or the entity offset property?
@Jackolantern
Right but only the entities (players,crits, walls, trees etc) are isometric in my game. I like the tiles square.And while it is another piece of commercial software you may not want to buy, if you are wanting to make an HTML5 isometric MMORPG, The Isogenic Engine may be exactly right for you. The "Online Edition" is specifically made for isometric HTML5 MMORPGs backed by Node.js.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Browser Based MMORG using Impact Please help :)
You could subclass the Entity class and remove some of the bulk that won't be needed for things like trees and walls by overriding unneeded methods with empty methods. The Game object automatically calls a lot of methods in each Entity on the screen, so that could help to speed up the game using so many entities.
The indelible lord of tl;dr
-
ShawnSwander
- Posts: 53
- Joined: Thu May 17, 2012 12:31 am
Re: Browser Based MMORG using Impact Please help :)
I think Ill do something along those lines but in may case its going to be a tedious process to populate the game with walls and trees without a map editor so for now I'm just pocketing concept I might put a few on my test map once I code the stuff I have totally figured out.Jackolantern wrote:You could subclass the Entity class and remove some of the bulk that won't be needed for things like trees and walls by overriding unneeded methods with empty methods. The Game object automatically calls a lot of methods in each Entity on the screen, so that could help to speed up the game using so many entities.
Maybe I'm stupid but why is this line of code...
Code: Select all
hexclickedx = ig.input.mouse.x % 55;returning the value in ig.input.mouse.x and not its modulus?