Page 2 of 4
Re: Brandons Adventure [WIP]
Posted: Thu Feb 07, 2013 5:24 pm
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
Re: Brandons Adventure [WIP]
Posted: Thu Feb 07, 2013 6:03 pm
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.
Re: Brandons Adventure [WIP]
Posted: Thu Feb 07, 2013 9:45 pm
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.
Re: Brandons Adventure [WIP]
Posted: Fri Feb 08, 2013 12:15 am
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 (45.98 KiB) Viewed 2297 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.
Re: Brandons Adventure [WIP]
Posted: Fri Feb 08, 2013 1:52 am
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.
Re: Legend of Rathnor [WIP]
Posted: Mon Jun 10, 2013 8:27 pm
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
Re: Legend of Rathnor [WIP]
Posted: Tue Jun 11, 2013 5:51 pm
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.
Re: Legend of Rathnor [WIP]
Posted: Tue Jun 11, 2013 10:48 pm
by jasonisop
Thanks for the fix ill get that in as soon as i can.
Re: Legend of Rathnor [WIP]
Posted: Wed Jun 12, 2013 2:13 am
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
Re: Legend of Rathnor [WIP]
Posted: Wed Jun 12, 2013 2:37 pm
by jasonisop
Added SneakySnake's changes.
Working on the camera code now, I think thats where the most bugs in the game are.