Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1391886 Posts in 66873 Topics- by 59646 Members - Latest Member: BMB

May 11, 2021, 09:17:36 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsXeen inspired, top-down, experimental RPG
Pages: [1]
Print
Author Topic: Xeen inspired, top-down, experimental RPG  (Read 815 times)
miroz
Level 0
*



View Profile
« on: April 22, 2021, 11:20:46 PM »

Code:
//TODO: Insert catchy name here

Code:
//TODO: Insert beautiful screenshot here

Motivation
Xeen games in Might and Magic series are some of my favorite CRPGs (Clouds of Xeen, Dark Side of Xeen and Swords of Xeen). It's hard to define what is good in the game, but for me, the excitement of exploration is what I remember the most. Couple that with other well-implemented mechanics like skill system where you have to find different trainers for different skills (introduced later in M&M VI), weapon attributes and magic system and you get that great mix.

I had the idea to work on such a game for a long time, but the clones already exist (Grimoire, Grimrock) and even similar classics are still playable (EOB, LOL, DM). Classics and Grimoire use fake 3d envirnoment with 2d sprites. Implementations using modern engines and 3d graphics exist (Grimrock) but having realistic 3D space limited to grid movement is just not that appealing. Old games had a level of abstraction that allowed the player's imagination to fill the gaps. You got just barebone, visual hints of what is actually happening in the game and you filled the rest using your imagination. Once you jump to realistic graphics, artificial limitations like a grid system fall into an uncanny valley. I don't want to repeat what's already there.

I have very limited graphics skills, negligible really, so I have to think simple and fill the gaps with clever instead of beautiful solutions. That lead me to try to implement the system as top-down, but keep the grid-based party. Similar to Xeen games, but without the first-person view. Like you are constantly looking on the map. I'm not sure if that can work at all, so before I get to the quest system, character progression and game rules, I want to test the basic mechanics first and get the feel of the game before I invest too much time in code and content. If the graphics I have in mind won't work for the game, there is no game.

Development
My time for the project is limited since I have a day job, but I'm working remotely, so this is another experiment: if I get up one hour earlier and start working immediately instead of coffee and surfing, can I squeeze in two hours of gamedev in the morning without neglecting my day job and family matters?

Devlog
I usually work in a bubble, not showing my work around until I find it presentable. This time I want to try the opposite: share the details of development and make a gif of all important milestones in development, showing prototypes and programmers art.

So, one programmer, limited time, no artist, what could go wrong?
Logged

miroz
Level 0
*



View Profile
« Reply #1 on: April 25, 2021, 11:15:19 PM »

Day 1-3 - Where I work on basic, basic movement

I can start with just two components: a map, and a party. I created a Unity project and spent some time to get mad at every system that doesn't work as I expected. Finally, I settled on using unity Tilemap and some tiles ripped from Civilization IV. This will work for now. Programer art, right? The main concept to test is the top-down view of the characters. I want to quickly see if this looks acceptable. I started with a party of 4 characters. Maybe it will be possible to increase the number to a maximum of 9, but four is a minimum. As in Xeen games, or any other classic dungeon crawler, you move the complete party, not individual characters. Movement is executed using arrow keys. A single arrow key press moves them one tile, but you can queue multiple movement commands and they will be executed in order. If you spot an enemy, the movement queue will be interrupted.


I got some top-down 2d sprite and traced it to create my sprite. It's a bit low-res, but let's see what can be done with this. From this version on, we can only improve. The first version is just some static movement with linear interpolation between points but after adding some physics to the formula, the movement looks bearable:



And now, to some basic animation. Somehow, pixel by pixel, I created a walk animation that doesn't hurt the eyes and deciphered Unity animation system to put it on the screen. Well, yesterday I didn't know how to do that:



Now the party moves but living creatures cannot move so uniformly, they are moving like a robotic army. I want the party to move like a bunch of individuals, not like the North Korean army under Kim Jong-un balcony. So instead of moving the party, I'll move the individual characters. First I added some noise to their final destination. They should all finish near the position defined by the formation, but not exactly there. I added some weight to the randomness so they don't stray too much, they prefer to return towards their formation point. That looks ok, they scatter a bit, but they still start and end the movement in unison, so I added some random delay to the start of each character's movement, with the back-row having a bit more delay.

They now look like a bunch of adventurers:



So that worked, I was able to do 90 minutes of gamedev in the early morning for three days straight without an impact on my day job. Actually, I feel more productive on both fronts. Let's see how long that lasts.
Logged

Ramos
Level 5
*****



View Profile WWW
« Reply #2 on: April 26, 2021, 01:02:03 PM »

Hey,

I am curious what will your creation evolve into. I am always into top-down games.

Also regarding art: do not forget that you can always find an artist to do it if you concentrate on the code.

PS: your avatar is amazing, terror from the deep? Big fan myself
Logged

miroz
Level 0
*



View Profile
« Reply #3 on: April 26, 2021, 11:16:02 PM »

I am curious what will your creation evolve into. I am always into top-down games.
Also regarding art: do not forget that you can always find an artist to do it if you concentrate on the code.

I'll try to get as far as I can before looking for an artist, just using assest. Based on previous experience, hiring an artist too early, if you're not on the same page, can lead to a lot of wasted time. I really like the Chromosome Evil art, though  Wink

PS: your avatar is amazing, terror from the deep? Big fan myself
Yeah, for some reason I played TFTD before the original, so it kinda remained my favorite XCOM game. Just rose-colored glasses, I guess.
Logged

Alain
Level 4
****



View Profile WWW
« Reply #4 on: April 27, 2021, 11:02:18 PM »

Yeah, for some reason I played TFTD before the original, so it kinda remained my favorite XCOM game. Just rose-colored glasses, I guess.

Funny, it was the same for me. I found out that X-Com existed after playing TFTD for a year or so. But I instantly preferred it to TFTD, because I liked the environments more.

Looking forward to see more of your game!
Logged

Ramos
Level 5
*****



View Profile WWW
« Reply #5 on: April 28, 2021, 01:23:50 PM »


I'll try to get as far as I can before looking for an artist, just using assest. Based on previous experience, hiring an artist too early, if you're not on the same page, can lead to a lot of wasted time. I really like the Chromosome Evil art, though  Wink

Yeah, for some reason I played TFTD before the original, so it kinda remained my favorite XCOM game. Just rose-colored glasses, I guess.

Thank you! It is heavily inspired by XCOM in gameplay and lore.

I played TFTD after Enemy Unknown but I love both. TFTD is mostly a reskin of EU but somehow managed to have more horror and claustrophobic atmosphere.

I have a rich imagination and after googling a bit about "Clouds of Xeen" I can picture some good gameplay here and because you choose top-down for this type of game I think it will stand out among the others of this type, so do not give up.

What theme have you choosen? Medieval, sci-fi, modern-day, etc?







Logged

miroz
Level 0
*



View Profile
« Reply #6 on: April 28, 2021, 09:48:48 PM »

@Ramos - a medieval fantasy - although M&M games end in a sci-fi setting, I'm not going there


Day 3-5 - Where party turns and fog of war falls on the map

Turning
The next movement problem is a bit tricky, turning. I can't just rotate the party sprite, because it looks like they stand on the rotating platform. When turning, all four characters must rotate around their own axis and then move. But when they do that, they will break formation, the front row will become left flank, back-row right.
To fix this, I needed some more movement code. Characters will switch places, depending on the path they'll wait a bit and move slower so they stay in formation. The result is, well, interesting.


A bit about graphics
The plan for the graphics is to keep it simple and old school, but use modern features like bump mapping to add detail to the terrain. I played a bit with normal maps and lightning, but I couldn't get any positive effect, so I abandoned that idea for now. But at least I removed the ugly grey line between some tiles. Point filtering FTW.

Then I played a bit with the camera, simple mouse wheel zoom and right-click move will suffice for now. I tried to add a camera that follows the party but my first implementation gave me a literal headache, it was too jerky. Future work.

Visiblity
After spending the time on invisible features, I had to implement something gifable. So I added the visibility feature. At first, you don't know anything about the world so the map is black (should be some nicer color or pattern). You can see the world only a few tiles around you, currently just one but it will depend on your skills and the type of terrain. Everything else is under the fog of war, visualized as a grey tint over the tile. Again, I'm thinking of desaturating the tiles instead of tinting them but again, future work. I played with the mask a bit, it needs at least some smooth edges to remove this blockiness, but such as it is, it represents the game state and this is enough for now.


« Last Edit: April 28, 2021, 09:56:04 PM by miroz » Logged

miroz
Level 0
*



View Profile
« Reply #7 on: May 03, 2021, 10:52:42 PM »

Day 6 - Where i reorganize code and nothing interesting happened

It was fun so far, but it's the most I can do without thinking much about code organization. Next, I want to add a better visibility system, so you can see far on the plains but in the forest and mountains you see just the tiles you are on. For that, I need to organize the code a bit. I split my code into two big sections: GameLogic and GameObjects. Since this is a turn-based game, game logic will calculate each turn, and drawing part will get the state changes and draw them. With that, I can simulate the game without graphics, even outside of Unity. I could test it by running multiple different instances to see if the game gets into some invalid state, and, possibly, optionally, let's just say it, it could run as a multiplayer game server. A girl can dream, right? So can I.

But as soon as I started working with classes that are not Unity's GameObject, Unity started behaving weirdly. Breakpoints would not be hit, sometimes I couldn't run the debugger at all. All that was resolved with the good old restart and deleting all temp data, but it took some time I can't get back. But the important is that the game is now divided into game states. For now, I have just two global game states: menu and game, and some play game states: waiting for input, players move, world move... The game waits for input and forwards the command to the game logic which returns actual player's action. The action is interpreted and animations are run. Then the world turn is calculated (enemies, npcs...) and animated and so on.

After working for a few hours, gameplay wise I am in the same spot as yesterday, but the code will be much nicer to work with. I made mistakes before with waiting too long before structuring the project, but not this time. This time I refactored.

To add something playable, I finished with limiting movement inside the map bounds, because before that, the party could wander outside in the void. I made them stop. I'll add some animation to that later.


Days 7-9 - Where I'm adding roads and forests

Finally, something visual, adding some roads. I kept it very simple, so I have just four road tiles, straight, corner, T-crossroad and 4-way crossroads. But now I went from one tilemap to two tilemaps overlayed so I had to change the code to handle multiple tilemap layers. As developers know, changing from one to multiple is hard, but now when I add another layer, it's just more of the same.

So, let's add some forest too. Again, keeping it simple, I added some sparse trees, because I want to see the characters through it and I don't have to worry about making the tile seamless (I tried, though, 'twas bad). I'll add some denser forests in the future and make characters visible with masking.



Next, better visibility.
Logged

Ramos
Level 5
*****



View Profile WWW
« Reply #8 on: May 06, 2021, 12:06:47 PM »

I like the way how you use the trees on the top layer, it gives a nice depth to the visuals
Logged

miroz
Level 0
*



View Profile
« Reply #9 on: May 06, 2021, 10:53:58 PM »


@Ramos - Yeah, the cheapest trick in the book.  But trees will need some shadows to ground them visually, they look like they are floating now. And shadows should be on the layer below the party.



Days 10-11 - Where forests block the linesight and my back starts to hurt

Linesight
And now to the main point of the forest. I want to have farther visibility on the plains, but forests should block the view. In the forest (or mountains), you can see only the tile you're on. I used Bresenham's circle drawing algorithm to generate the circle around the party, and then using Bresenham's line drawing algorithm, shot rays from origin to every point on the circle. Forest and mountains will block the ray. Unfortunately, as I used a boolean visible state, the effect is not satisfactory because you should see the edge of the forest from afar, but not into the forest.


To improve this, I tried to use the mask that will show the edges of the tiles that are visible to the party. After many hours of trying, I finally got what I wanted. And it looked terrible. It doesn't even deserve a screenshot.

The problem is, I wanted the wrong thing. I should use the same system for all tiles, not only obstacles. You can't have blocky visibility in the open field but rounded masking around the forest. This opens a rabbit hole, where I would implement lightning and shadows and whatnot. So I scrapped this and replaced it with a much simpler model. I added a third visibility state: obscured. So the forest is visible but shadowed, except if the party is in the forest.

Could be prettier, but it will serve the purpose.

With that done, I can start with more fun parts, like some combat.

Other problems
Well, my back started to hurt. Yes, I'm spending more time in front of the computer now through a bit longer stretches of time, but I'm programming for a living for years, I learned how to sit and how to stretch and workout regularly. And my problems are usually with the lower back, and now the pain is high up. What happened now in 10 days of working on a game?

I analyzed a bit. When I'm doing some standard back-end web development, I sit back, relax, put my fingers on the keyboard and type. And I stay this way. But for game development? I start like that, but then I run the game, I notice some jerky movement or pixel that's in the wrong position and I slouch forward to better see what's on the screen. And then I stay that way and start to type while in this position and see something else that requires slouching and so I spend hours slouched forward, my expensive back-supporting chair being used as a plain wooden stool.

I moved my screens a bit closer, switched the mouse from right to left side just to break my focus and made mental note to check my pose every now and then. We'll see.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic