Legends of Rathnor [WIP]

Show off your games, demos and other (playable) creations.

What kind of spell system do you like in RPG's

Spells gained automaticly based on level and class - like dragon warrior
4
17%
Pick your spells from a list of pre-made spells - like D&D 3.5 edition
8
33%
Create your own spells as you go - you would have to learn/find words to combine to form your own spells
12
50%
 
Total votes: 24

User avatar
jasonisop
Citizen
Posts: 93
Joined: Thu Jun 21, 2012 1:35 am

Re: Brandons Adventure [WIP]

Post by jasonisop »

Ive also noticed that the frame rate is low when your not moving, drops to like 12 or so but when moving is when i get decent frame rates
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Brandons Adventure [WIP]

Post by Roland_Yonaba »

I tried it, and it works fine.
I am on Windows 8, x64, for what it's worth.
It's a bit buggy, though, but looks good. Maybe i'll send some pull requests on Github next.

Keep up the good work.
User avatar
jasonisop
Citizen
Posts: 93
Joined: Thu Jun 21, 2012 1:35 am

Re: Brandons Adventure [WIP]

Post by jasonisop »

It's not a bit buggy its a lot buggy. Im still not use to lua, and most the code was slapped together very quickly to try and make the lpc deadline.
Right now im trying to clean up/comment all the code, there are area's that need complete re-writes, and alot of the games systems need implemented.

I am very open to comments on how I coded things and would love the input on how to make it better.
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Brandons Adventure [WIP]

Post by josefnpat »

Nice job setting everything up! I see you're using tiled, but the game is lagging way more than it should be.
7ThGvBi.png
7ThGvBi.png (45.98 KiB) Viewed 2295 times
Here you can see I'm getting like 13fps. Perhaps it's because you're not limiting the draw range?

On luascripts/Map.lua:80 it seems like you have some code, but then there's a lot of commented out stuff. Are you sure you have it set up right?

Also, you'll notice that the map doesn't center on the character, and if you keep moving in one direction, you can walk off the map.
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
jasonisop
Citizen
Posts: 93
Joined: Thu Jun 21, 2012 1:35 am

Re: Brandons Adventure [WIP]

Post by jasonisop »

It should only be rendering just outside the bounds of the screen, i tested by making it only render a smaller portion in the center of the screen and my frame rates are about the same (70+ while moving and 13-17 when standing still). I still dont know why the better frame rate while moving. My tiled map is has a lot of layers (about 20) and a lot of tilesheets (about 20 as well) and im assuming thats what keeping my frame rate down. I did notice that the enemies are still rendering out side the camera bounds, so that needs to be fixed as well.


The player will move out of the camera view, after going in the building and going back out, thats something that still needs fixed.

EDIT: I tried the map out using zoetrope and I only got 13-16fps and that was with using one large tilesheet 1024x1024 compared to the 20 smaller ones. I also tried using gamera and had similar results, but im not sure i had it set up 100% correctly. I think its not so much the size the map but that it has 20 layers, and even with limeting the draw area its still a whole lot of tiles that need rendered.
User avatar
jasonisop
Citizen
Posts: 93
Joined: Thu Jun 21, 2012 1:35 am

Re: Legend of Rathnor [WIP]

Post by jasonisop »

The game name has been changed, and there is a massive increase on the framerate.

In the works
Redo of the camera code
Pathfinding
NPC AI
Data Storage
Using Tiled fully for easy placement of NPC's (quest, items, dialog, ect...)
A Character generation screen
A working inventory
User avatar
SneakySnake
Citizen
Posts: 94
Joined: Fri May 31, 2013 2:01 pm
Contact:

Re: Legend of Rathnor [WIP]

Post by SneakySnake »

I use LuaJit, and got the same error the others are talking about, so I did a bit of debugging.
The problem lies in the variadic functions. arg does not actually hold the arguments, rather the command line arguments. Why?
http://luajit.org/faq.html wrote: Q: Why do I get this error: "attempt to index global 'arg' (a nil value)"?
Q: My vararg functions fail after switching to LuaJIT!
LuaJIT is compatible to the Lua 5.1 language standard. It doesn't support the implicit arg parameter for old-style vararg functions from Lua 5.0.
Please convert your code to the Lua 5.1 vararg syntax.
Here is a patch that fixes the two problematic uses of arg.

Code: Select all

diff --git a/main.lua b/main.lua
index 92caf10..ea890f0 100644
--- a/main.lua
+++ b/main.lua
@@ -43,6 +43,7 @@ function Game:removeEnemys()
 end
 
 function Game:registerMap(...)
+	local arg = {...}
 	for k,map in ipairs(arg) do table.insert(Game.mapList,map) end
 end
 
diff --git a/scripts/Enemy.lua b/scripts/Enemy.lua
index fe7c33f..7afe576 100644
--- a/scripts/Enemy.lua
+++ b/scripts/Enemy.lua
@@ -18,6 +18,7 @@ end
 function Enemy:registerEnemy(mapId , ... )
 	
 	self.container[mapId]= {}
+	local arg = {...}
 	for k,enemy in ipairs(arg) do 
 		table.insert(self.container[mapId],enemy) 
 		enemy:setLocation(enemy:getTileX(),enemy:getTileY(),enemy:getFacing())

I don't know if there are more, the game seems to work fine now.
User avatar
jasonisop
Citizen
Posts: 93
Joined: Thu Jun 21, 2012 1:35 am

Re: Legend of Rathnor [WIP]

Post by jasonisop »

Thanks for the fix ill get that in as soon as i can.
User avatar
vitaminx
Citizen
Posts: 95
Joined: Fri Oct 19, 2012 7:16 am
Location: international
Contact:

Re: Legend of Rathnor [WIP]

Post by vitaminx »

Hey, just tried your latest version from github and there's still sometimes a huge framerate drop when changing moving direction, I've opened an issue for that:

https://github.com/jasonisop/lpc_game/issues/6
User avatar
jasonisop
Citizen
Posts: 93
Joined: Thu Jun 21, 2012 1:35 am

Re: Legend of Rathnor [WIP]

Post by jasonisop »

Added SneakySnake's changes.

Working on the camera code now, I think thats where the most bugs in the game are.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests