I've integrated the astray library for generating dungeons.
The map drawing code has been improved and cleaned up. The mysterious offset which sometimes happened to sprites/labels/overlays doesn't happen anymore. Turns taking by monsters is now more performant, without the debug pause in between.
I also tried to make the camera viewport work, but it isn't working as it should - it doesn't follow the player and it doesn't stop at lg.getHeight()-70, only at window edge. I will probably need a hand there!
Porting my own Veins of the Earth to LOVE
Re: Porting my own Veins of the Earth to LOVE
- Attachments
-
dev.love
- (1.33 MiB) Downloaded 166 times
Re: Porting my own Veins of the Earth to LOVE
I finally have a working viewport code, thanks to replacing hump's camera lib with gamera. The map drawing code has been optimized to draw only in camera viewport.
The test case is the test room upped to 40x40. The camera is 640 px x 640 px, starting at x = 120 px to account for the HUD on the left side.
I left the space at the bottom empty (default window height is 768 px) since this is where the second HUD part will go.
640 px is a nice multiple of both 32 and 64, as I plan to switch to 64x64 tiles as default at some point and then offer a zoom in/out functionality.
I also fixed an issue that kikito spotted while helping me out (a missed call to loadfile(), which doesn't work in .love form).
The test case is the test room upped to 40x40. The camera is 640 px x 640 px, starting at x = 120 px to account for the HUD on the left side.
I left the space at the bottom empty (default window height is 768 px) since this is where the second HUD part will go.
640 px is a nice multiple of both 32 and 64, as I plan to switch to 64x64 tiles as default at some point and then offer a zoom in/out functionality.
I also fixed an issue that kikito spotted while helping me out (a missed call to loadfile(), which doesn't work in .love form).
- Attachments
-
dev.love
- (1.33 MiB) Downloaded 133 times
Re: Porting my own Veins of the Earth to LOVE
You can now drop items from inventory.
I've also begun working on a player-oriented turns display - at the top left corner of game area. However it has empty space where the non-visible entities would be. I need to somehow make a table without the non-visible entities while preserving the ordering. The player sprite at the top of game area that doesn't really move is part of that display.
Just walk around and pick up some things - this should bring some NPCs to investigate and you can see it in action.
How do I do filter the entities table? So that I can get rid of the empty space? I've already got some code which only grabs the visible entities, but the resulting table has a vastly differing ordering.
I've also begun working on a player-oriented turns display - at the top left corner of game area. However it has empty space where the non-visible entities would be. I need to somehow make a table without the non-visible entities while preserving the ordering. The player sprite at the top of game area that doesn't really move is part of that display.
Just walk around and pick up some things - this should bring some NPCs to investigate and you can see it in action.
How do I do filter the entities table? So that I can get rid of the empty space? I've already got some code which only grabs the visible entities, but the resulting table has a vastly differing ordering.
- Attachments
-
dev.love
- (1.43 MiB) Downloaded 128 times
Re: Porting my own Veins of the Earth to LOVE
Coming along nicely.
Getting this error when trying to get into the game:
Getting this error when trying to get into the game:
Code: Select all
Error: cannot open data/calendar.lua: No such file or directory
stack traceback:
[C]: in function 'dofile'
T-Engine/Calendar.lua:46: in function 'init'
T-Engine/class.lua:82: in function 'new'
gamemodes/game.lua:54: in function 'load'
gamefunctions.lua:20: in function 'loadGamemode'
gamemodes/menu.lua:12: in function 'keypressed'
main.lua:56: in function <main.lua:53>
[string "boot.lua"]:454: in function <[string "boot.lua"]:435>
[C]: in function 'xpcall'
Re: Porting my own Veins of the Earth to LOVE
Sorry about that
, I missed a dofile() call when porting code.
Along the way, I fixed that "empty space" in player turn order display problem. The turn order updates with a slight delay, I will have to look into moving the relevant function somewhere earlier, but it's fully functional!
That means 90% of the UI is functional, time to improve the Area code so that it can change levels (stairs, whatever) and load areas from data. Hopefully without repeating the dofile() whoopsies with other data-loading functions ported lol.
Then it's time for content... The T-Engine game had 39 areas and a ton of items and NPCs to find.

Along the way, I fixed that "empty space" in player turn order display problem. The turn order updates with a slight delay, I will have to look into moving the relevant function somewhere earlier, but it's fully functional!
That means 90% of the UI is functional, time to improve the Area code so that it can change levels (stairs, whatever) and load areas from data. Hopefully without repeating the dofile() whoopsies with other data-loading functions ported lol.
Then it's time for content... The T-Engine game had 39 areas and a ton of items and NPCs to find.
- Attachments
-
dev.love
- (1.43 MiB) Downloaded 135 times
Re: Porting my own Veins of the Earth to LOVE
I heard back from an artist I contacted regarding his tileset. His reply was positive, so I sat down and implemented something that's been tickling the back of my brain ever since I saw the capabilities of LOVE2D.
https://love2d.org/imgmirrur/I0kvAWy.gif
Zooming in (64x64) or out (32x32) at will - an animated GIF
You press Shift + to zoom in and Shift - to zoom out. For those who don't know, + and - are the keys right next to numbers, above the letter keys. The map UI scales to fit (the grid, the border around moused-over tile, the ellipses indicating the actor's attitude, the damage splashes).
You can see the tiles for the actors change, but not for items, which are offset a bit compared to 32x32, and terrain is simply scaled up for now (however I plan to find some good-looking walls in the bigger size). So it's not simply "scale up stuff".
I am thinking on what to name the two modes - "zoomed in" and "zoomed out" sounds silly. I plan to implement some indicators that would be visible only in the "zoomed in" mode (because of the larger amount of space per tile, simply), such as a number telling you how many items are there in a tile or a small icon indicator (8x8?) for monsters which have special abilities of some kind. (Said special abilities aren't implemented yet)
https://love2d.org/imgmirrur/I0kvAWy.gif
Zooming in (64x64) or out (32x32) at will - an animated GIF
You press Shift + to zoom in and Shift - to zoom out. For those who don't know, + and - are the keys right next to numbers, above the letter keys. The map UI scales to fit (the grid, the border around moused-over tile, the ellipses indicating the actor's attitude, the damage splashes).
You can see the tiles for the actors change, but not for items, which are offset a bit compared to 32x32, and terrain is simply scaled up for now (however I plan to find some good-looking walls in the bigger size). So it's not simply "scale up stuff".
I am thinking on what to name the two modes - "zoomed in" and "zoomed out" sounds silly. I plan to implement some indicators that would be visible only in the "zoomed in" mode (because of the larger amount of space per tile, simply), such as a number telling you how many items are there in a tile or a small icon indicator (8x8?) for monsters which have special abilities of some kind. (Said special abilities aren't implemented yet)
- Attachments
-
dev.love
- (1.46 MiB) Downloaded 147 times
Re: Porting my own Veins of the Earth to LOVE
That doesn't work in my keyboard. You'd be better off using the scancode argument provided by LÖVE 0.10 for that purpose.Zireael wrote:You press Shift + to zoom in and Shift - to zoom out. For those who don't know, + and - are the keys right next to numbers, above the letter keys.
Re: Porting my own Veins of the Earth to LOVE
How does one use the scancodes? I am seeing no keypressed(scancode) function in the wiki... help?pgimeno wrote:That doesn't work in my keyboard. You'd be better off using the scancode argument provided by LÖVE 0.10 for that purpose.Zireael wrote:You press Shift + to zoom in and Shift - to zoom out. For those who don't know, + and - are the keys right next to numbers, above the letter keys.
- zorg
- Party member
- Posts: 3480
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Porting my own Veins of the Earth to LOVE
Code: Select all
function love.keypressed(keycode, scancode, isRepeat)
-- Just use the scancode argument instead of the keycode.
end
function love.keyreleased(keycode, scancode)
-- Same here.
end
down = love.keyboard.isDown(keycode1, ...) -- Works with 1 or more keycodes (true if any is down, not all)
down = love.keyboard.isScancodeDown(scancode1, ... ) -- Works with 1 or more scancodes (true if any is down, not all)
Me and my stuff
True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

Re: Porting my own Veins of the Earth to LOVE
Ok, I converted all the keypressed functions to take scancode instead.
It seems to work on my keyboard. Pgimeno, can you give it a try?
It seems to work on my keyboard. Pgimeno, can you give it a try?
- Attachments
-
dev.love
- (1.46 MiB) Downloaded 137 times
Who is online
Users browsing this forum: No registered users and 7 guests