## Porting my own Veins of the Earth to LOVE

Show off your games, demos and other (playable) creations.
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

### Re: Porting my own Veins of the Earth to LOVE

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!
Attachments
dev.love
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

### 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).
Attachments
dev.love
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

### 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.
Attachments
dev.love
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

### Re: Porting my own Veins of the Earth to LOVE

Coming along nicely.

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'
main.lua:56: in function <main.lua:53>
[string "boot.lua"]:454: in function <[string "boot.lua"]:435>
[C]: in function 'xpcall'

Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

### 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.
Attachments
dev.love
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

### 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.

http://i.imgur.com/I0kvAWy.gifv
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
pgimeno
Party member
Posts: 3283
Joined: Sun Oct 18, 2015 2:58 pm

### Re: Porting my own Veins of the Earth to LOVE

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.
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
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

### Re: Porting my own Veins of the Earth to LOVE

pgimeno wrote:
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.
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.
How does one use the scancodes? I am seeing no keypressed(scancode) function in the wiki... help?
zorg
Party member
Posts: 3282
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)
There's also getScancodeFromKey and getKeyFromScancode, but since it only ever uses SDL's own US english keycode layout, it's somewhat useless.
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.
Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

### 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?
Attachments
dev.love