Jump to content


Lotias

Member Since 21 Jun 2010
Offline Last Active Today, 03:36 AM

Topics I've Started

Html5 Path Problems

01 June 2013 - 06:34 PM

So I've got a platformer pathfinding AI working in HMTL5, based on this set of scripts, except when I try to perform special operations on the actual path, the code 'exits' when there isn't even an exit statement and the path is thus never followed.

 

I'm trying to use two scripts:

//path_clean(ind)
//removes unnecessary points on a path
var n,x1,y1,x2,y2,x3,y3,mypath;
mypath=argument0;
if path_get_number(mypath)>2
        {
        for (n=1; n<path_get_number(mypath); n+=1)
                {
                x1=path_get_point_x(mypath,n-1)
                y1=path_get_point_y(mypath,n-1)
                x2=path_get_point_x(mypath,n)
                y2=path_get_point_y(mypath,n)
                x3=path_get_point_x(mypath,n+1)
                y3=path_get_point_y(mypath,n+1)
                if ((x2-x1)*(y3-y2)=(x3-x2)*(y2-y1) && (!place_meeting(x2*48,(y2*48)+48,obj_block) || y2 = y3))
                        {
                        path_delete_point(mypath,n)
                        n-=1
                        }
                }
        }
//create_nodes_path(path)
var pth,nodes,obj,nodex,nodey,node2y,node2x;
pth=argument0;
nodes=path_get_number(pth);

node_a = 0;

for(i=0;i<nodes+1;i+=1)
 {
 nodex=path_get_point_x(pth,i);
 nodey=path_get_point_y(pth,i);
 node2x=path_get_point_x(pth,i);
 node2y=path_get_point_y(pth,i);
 
 node_a[i,0] = (nodex * 48) + 24; //node x
 node_a[i,1] = (nodey * 48) + 24; //node y
 node_a[i,2] = 0; //type of jump; 0 = no jump; 1 = arc jump
 node_a[i,3] = (node2x * 48) + 24; //jump x
 node_a[i,4] = (node2y * 48) + 24; //jump y
 
 if i<nodes
  {
  node2x=path_get_point_x(pth,i+1)
  node2y=path_get_point_y(pth,i+1)
  if !place_meeting(node2x*48,(node2y*48)+48,obj_block)
   {
   node2y=path_get_point_y(pth,i+2)
   node2x=path_get_point_x(pth,i+2)
   node_a[i,2] = 1
   };
  if node2y < nodey || (node2y > nodey && abs(node2x - nodex) > 1)
   {
   node_a[i,2] = 1
   };
  }
  else
  {
  node2x=nodex
  node2y=nodey
  };

 node_a[i,3] = (node2x * 48) + 24
 node_a[i,4] = (node2x * 48) + 24
 };

And both scripts cause the exact same problem. I've also been unable to nail down where exactly it's cutting off. The scripts are getting called here:

yy = y;
move_snap(48,1);

show_debug_message("Starting!")

pathx = x;
pathy = y;

x = xx;
y = yy;

if (platformer_astar(grd_ai,path_ai,(pathx)/48,(pathy-24)/48,round((obj_player.x)/48),round((obj_player.y-24)/48),height,jump,5,irritations))
 {
 show_debug_message("Cleaning path!");
 path_clean(path_ai);
 create_nodes_path(path_ai);
 show_debug_message("Path cleaned!");
 following=true
 
 show_debug_message("Playing sound!");
 h5s_play_sound(snd_swipe)
 current_node = 0;
 max_mode = path_get_number(path_ai);
 
 path_start(path_ai,2,0,0);
 path_scale = 48;
 
 show_debug_message("Path begun!");
 }
 else
 {
 show_debug_message("Must teleport to reach player!")
 x=obj_player.x
 y=obj_player.y
 };

And the debug text "Path cleaned!" is never outputted, until I remove BOTH scripts; leaving either in causes the code to exit upon being called. I've confirmed that the actual pathfinding scripts work perfectly in HTML5 (once I removed all the obsolete functions).

 

The functions above work fine in Windows, which makes me think there's a bug involving path functions in HTML5.

 

What on Earth is going on here?


Snowy Mountains Background Needed

28 April 2013 - 10:43 PM

So for my game Heir, I've got most of the art done for snowy areas, except the background seems really empty.

I decided it needs a background depicting mountains with lots of snow on them, and maybe a few (snowy) trees.

 

This is what the art I've done looks like (which the style of the background needs to fit):

kqiyc.jpg

 

The background must be in .png format.

 

 

Size: 640 x 480

View: Platformer

Colors: Whatever parts of the mountain that are covered in snow should match the color scheme above. Whatever parts of the mountain that aren't covered in snow should be a gray, rocky surface.

 

Note: If you add trees, please provide a version without trees and with.

 

Credit will be given.


Heir Engine 0.0.12 [Last Updated: 6/5/2013]

25 April 2013 - 01:22 AM

Heir Engine v. 0.0.12

Screenshots (not up to date):

2iae69x.png

15cf0k2.png

21bm1ox.png

33cqf0n.jpg

2q0r7mw.png

 

Description:

A platformer RPG engine I've been working on since the beginning of 2013.

The platforming includes ledge grabbing, wall-jumping, wall-sliding, and fall damage.

The not-in-game quest system is fully fleshed out, with multiple objectives a quest and the capability to randomly generate quests.

 

Controls are mostly explained in-game. Controls can be viewed/changed in the Options section of the inventory. (Opened by pushing I)

 

I do have a soundtrack in the works, but no music is in-game due to HTML5 still having problems with playing music.

You can listen to the soundtrack here;

Heir Soundtrack

 

Recent Changes:

Various bugs fixed, new follower test AI.

Bug details here:

http://gamejolt.com/...bug-fixes/5176/

 

Currently Working On:

1. The game's plotline.

 

On the To-do List:

1. Get music working.

2. Finish writing the 'first chapter' of the game.

 

Game:

Heir Engine (Gamejolt)


Parallax Problems

14 April 2013 - 09:32 PM

I've been trying to edit the Responsive Parallax Scrolling example for my game, but I'm having several problems. So far, I have it set up in my background object like this:

 

Create event:

bxx[0]=background_x[0];
byy[0]=background_y[0];
background_visible[0] = false;
bxx[1]=background_x[1];
byy[1]=background_y[1];
background_visible[1] = false;
bxx[2]=background_x[2];
byy[2]=background_y[2];
background_visible[2] = false;
bxx[3]=background_x[3];
byy[3]=background_y[3];
background_visible[3] = false;

 

Draw event:

i=0;
repeat(4)
 {
 bxx[i]+=background_hspeed[i];
 byy[i]+=background_vspeed[i];
 
 draw_horizontal_tiled(background_index[i],view_xview*(1-(0.1*i))+bxx[i],view_yview*(1-(0.1*i))+byy[i])
 
 i+=1
 };

 

Draw_horizontal_tiled script:

//draw_horizontal_tiled(background,x,y)
var back,width,xx,yy,left,right,i;
 
back=argument0;
width=background_get_width(back);
xx=argument1;
yy=argument2;
left=-1;
right=view_xview[view_current]/width+view_wview[view_current]/width+1;
 
 for (i=-1; i<right; i+=1)
  {
  draw_background(back,xx mod width+width*i,yy);
  }; 

 

EDIT:

I've fixed the original problem (which turned out to be a background not actually existing) but now there's another one;

The backgrounds do move more smoothly but not as smoothly as when running in Windows as compared to HTML5. Is this just something HTML5 does or is there a way to fix it?


Game Crashes Every Time In Chrome

16 March 2013 - 04:57 PM

Whenever I try to run my HTML5 game in Chrome lately, the page will crash and display the infamous "Aw, snap!"
I've cleared my cache, local temp folder, and everything, and this still will not work.
The problem persists even when I use a different install of Chrome. It works fine in other browsers.
What do I do?