Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411426 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 11:02:55 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsThe Foregunners
Pages: [1]
Print
Author Topic: The Foregunners  (Read 7362 times)
Sustrato
Level 1
*


It's a good day to die.


View Profile
« on: October 18, 2016, 06:49:56 PM »

The Foregunners: In Technicolor 3D
Latest Update



Who were the Fᴏʀᴇɢᴜɴɴᴇʀs?
What happened to their mythical inventions - the Dʀɪʟʟs and Bᴏssғɪɢʜᴛᴇʀs that made war with them?
When did they realize the Fᴜʀɴᴀᴄᴇ infection could not be stopped?
Where did they send their Lɪɢʜᴛs and the Pɪʟᴏᴛs who tended them?
Why did they start the galaxy-spanning Rᴀᴅɪᴏ Wᴀʀs?
How will you change their story?

Hey all. Thanks for checking my thread out.

I'm developing a twin-stick MOBA/roguelike, balanced by means of different damage/defense types, and played from an orthographic top-down perspective with 2d sprites rendered to a 3d field. I've been inspired by many games and other sources, but the original arc words for this project were taken from an interview with Kozilek in which he described the music for Luftrausers as "stupidly heroic". Those words send me into a maniac spiral in which I designed the iconic unit of the Foregunners series, a Fairchild A10 Thunderbolt, aka the Warthog, resting atop a pair of caterpillar treads. That was four years ago. My life has never been the same.

Check out some GIFs, yo.


Adorable sperm particles.


These ramps look even sexier since the latest update, which also broke physics.
« Last Edit: November 22, 2016, 09:43:09 AM by 7heSama » Logged

Sustrato
Level 1
*


It's a good day to die.


View Profile
« Reply #1 on: October 25, 2016, 08:19:11 PM »

I lie awake believing, that somehow I keep failing
I rail and I ache -
At the monsters and the demons, I've wrestled with for eons
And I want to destroy.

-- Garbage

First, I got slopes working about 95% (the only hangups being a. have to improve the height algorithm for angles and b. it requires one-way platforms at the top which causes some restrictions on map design, but I'll probably just deal with that).

Second, for no reason except the gloy, I spent three hours making a skull map. Here's another gif showing off the camera system (click for the full animation):



Third, I'm working on how to structure interacting behaviors, because that's been a huge headache. Forgive me if I use any terms wrong (I don't have much formal CS training), but essentially my plan right now is to create interfaces that will be implemented by both collections (i.e. specific units, buildings, etc) and general behaviors (a weapon, a patrol pattern, etc).

For instance -
ISpatial would have methods for Bounds and Position,
ISim for Physics,
IWar for Attack and Defense, and
ILogic for Idle, Advance, and Retreat.

SimBody could implement ISpatial and ISim to have a complete physics package.
Turret could implement IWar and ILogic to rain death upon the enemies of the machine.
And Tank would implement all four, redirecting it's calls to SimBody and Turret references it stores.

I'm not certain this is the right plan, but it's the best way I see to avoid excessive duplication of code and major refactoring every time I make a change. Hopefully it will be very easy to tweak and understand. The problem I'm tying to figure out right now is how to handle fields that must be shared across multiple interfaces (for instance, ILogic and ISim both need to know position). I will probably end up having some public fields and hope I'm smart enough in my own code to not go changing values I shouldn't be changing. We'll see how that goes.
« Last Edit: November 14, 2016, 05:17:37 AM by 7heSama » Logged

Sustrato
Level 1
*


It's a good day to die.


View Profile
« Reply #2 on: November 10, 2016, 06:04:14 PM »

Transmitting.
Signal coming through?
Okay.

-- The Flobots

Implemented a semi-functional raycasting system to be able to target different levels:



The main problem is it's calculated in steps, so it'll pass through the top of a tile without detection if it's close enough to the edge. To mitigate this as well as add in diagonal tiles (in the XY), I'm going to redo the code for physics, having each tile defined as 8 true/false points to calculate the edges and planes of their faces. You can see diagonals in that latest gif, but they don't collide properly. I'm confident I'll be able to manage it, but it will be a slow and bug-infested safari.

In other news, I've got a pretty solid design for the mechanics and overall progression locked in. It's essentially going to be an AARP with shmup-like controls; however, the idea is to have a lot of subtle interaction and emergent gameplay between different entities in the world, as well as a unique weapon balance system. Might take a few years to nail down, but we'll get there (assuming Trump doesn't kill us all first).
Logged

Pixel Noise
Level 10
*****



View Profile WWW
« Reply #3 on: November 11, 2016, 06:17:56 AM »

Like the concept art, and the concept. Following  Hand Thumbs Up Left Hand Thumbs Up Right
Logged

Pixel Noise - professional composition/sound design studio.
 https://soundcloud.com/pixel-noise
 https://twitter.com/PixelNoiseMusic
 https://pixelnoisemusic.bandcamp.com/

Recently completed the ReallyGoodBattle OST!  https://www.youtube.com/watch?time_continue=2&v=vgf-4DjU5q
Sustrato
Level 1
*


It's a good day to die.


View Profile
« Reply #4 on: November 11, 2016, 09:02:52 PM »

Thanks Pixel Noise! I followed you on soundcloud, too! But don't spread my profile around or anything, no one needs to hear that.

I feel weird posting such a short reply so here's some typography work I did today, was gonna use it as a forum sig but it's definitely too big. Based on the Flobots "Fight With Tools" album cover art.

Logged

Sustrato
Level 1
*


It's a good day to die.


View Profile
« Reply #5 on: November 13, 2016, 09:17:37 PM »

Demons! Come on!
You've got a vision!
You're on a mission!

-- Sleigh Bells

Made units push each other apart, as well as some basic enemies that will follow you around and/or shoot at you. So I guess it's kind of a real game now.



It's nothing special which just goes to show how much I need to improve my workflow, as it was several hours/hundred lines of code. Sh!t's gotta get boxed up in a nice component system or something, yo. The scope of this game is way too big to count spaghetti code as progress; it'll just slow me down.

Also, some more typography, including eight icons representing strength (first column) or weakness (second) in the four primary combat-stats of the game; Armor, Shields, Kinetic damage, and Electromagnetic damage. They need work to be more legible too, but I'm fairly happy with the KE/EM strength icons (a Lewis Gun style pan magazine and beam splitter, respectively - oh, shoot, just realized the EM and Shield are switched, oh well) and pretty pumped to be able to integrate them into text so easily.

Logged

flipswitchx
Level 3
***



View Profile WWW
« Reply #6 on: November 13, 2016, 10:40:25 PM »

Neat style on the vehicles, reminds me of a graphic novel  Beer!
Logged

io3 creations
Level 10
*****



View Profile WWW
« Reply #7 on: November 14, 2016, 10:18:44 AM »

The concept art is looking good!

I feel weird posting such a short reply so here's some typography work I did today, was gonna use it as a forum sig but it's definitely too big.

Compared to BeautifulGlitch's sig image, your's is "normal" Grin https://forums.tigsource.com/index.php?topic=51528.msg1296811#msg1296811 
Logged

Sustrato
Level 1
*


It's a good day to die.


View Profile
« Reply #8 on: November 14, 2016, 08:30:30 PM »

Only the strongest will survive
Lead me to heaven when we die

-- Breaking Benjamin

Hahah true io3, if my art approaches that point I'll consider it! And thanks for coming to check me out from the Irkalla thread! I added a link to my sig like you suggested, it's not super noticeable but I'll get some nice art at some point.

And thanks to both you and flipswitchx for the compliments to the vehicles, they're somewhat the centerpiece of the setting so expect them to improve a lot.

I feel very weird posting replies to my own thread w/o having progress. The good news is it's very motivating, and I've gotten more done the past two nights than probably the week before that. The bad news is it's entirely spaghetti code that I'll probably have to tear out in the future...

So, in that vein, I improved the damage code to account for the different types of damage/defense, as well as adding basic wreck particles (health is in the GUI, but not in the area of the gif):



The order of damage is thus;
1. If Shields > 0, KE is reduced by half and EM is dealt to shields.
2. If Armor > 0, EM is reduced by half and both EM/KE are dealt to armor.
3. If Hull > 0, EM and KE are both dealt to armor.
4. If Hull < 0, you're dead.

So note this is not necessarily linear; for instance, if shields are up but armor is down, KE will be reduced and then dealt to Hull, while EM will be dealt at full strength to shields. The interactions and baseline ratios between the different stats result in a required combined-arms approach; the kill time for one unit against a toughened (relative to their damage output) enemy target can be as long as 50 seconds (not represented in the above gif because I pumped up the damage for speed of action), while two units with mixed damage can take down the same target in something like 5.5 seconds.

I have the calculations in another file, it will certainly take a lot to fine-tune, but yeah, that's the gist. This was envisioned as my twist on the MOBA-style magic/physical damage balance. But before that, there's much to do -

1. Improving physics
2. Turning this spaghetti code into nice prepackaged spaghetti meals that I can order for any day of the week (i.e. a componenet system)
3. Improving graphics
4. Defining how the world is going to interact/track state/be managed (large maps w/ procgen and ARPG progression make this one of the bigger challenges)
5. Understanding the first thing about AI

And that's a short list.

The next couple days are going to be pretty quiet, lots of work and such, but I might try to make some concert art. Anyways thanks to everyone for their kind words, you are the tugboats hopefully getting this thing up to a speed where it's self-sustaining.
Logged

Skydsgaard
Level 1
*



View Profile
« Reply #9 on: November 18, 2016, 09:42:17 AM »

Great concept! The font and icon designs are super cool. A minor concern about the flat color floor: You lose sense of movement when you are alone in the screen (animated gifs). You lose any possible reference of what direction you are going or if you are moving at all. Maybe to include a color variance of tiles, or some kind of detail would help!

Anyway, I hope to see more progress of this project soon! <3
Logged

Sustrato
Level 1
*


It's a good day to die.


View Profile
« Reply #10 on: November 20, 2016, 07:12:53 PM »

And the moral of the story is...
And the moral of the story is...

Work! Just work!
-- Watsky

Thanks for checking out the thread, Sky! I definitely agree about the lack of reference when you're moving in an empty space. Right now the only actual tiles are the structures, so the ground is just the background color. The main concerns for adding detail are
1) levels will almost certainly be procedurally generated, so I'm concerned about how to stitch different areas together (esp. w/r/t elevation).
2) the potential memory/performance cost.

Additionally, I'd like to implement a dynamic lighting system and possibly some effects that will deliberately contribute to a sense of confusion, even getting the player lost sometimes.

All that is up in the air right now tho, so I will work on some placeholders to help with orientation! They'll be in the next update! But before that...



Hot damn! I coded a method that will translate a 3D position into 2D screen coordinates. This requires some explanation of Foregunner's camera system, which is complete garbage.

For rendering sprites, the process basically goes like this: the starting position is the X, Y of the obj's world position. This is offset by a unit vector drawn from the inverted rotation of the camera and scaled by the z-depth (i.e. altitude) of the world position. Z-depth is also used to calculate rendering depth (which eventually will be changed to a layer-by-layer rending that eliminates the need for this redundant calculation, or at least reduces the cost). Then the camera rotates the image as well as squashes it in the XY planes by the zoom scaler, and the Y plane additionally by a "Perspective" scaler (all told, the cam is controlled by Position, Zoom, Rotation, and Perspective, but Perspective is just a subcomponent of Zoom).

So this is some complicated-ass bullsh!t compared to using a normal 3d projection matrix. Why do it? Well, I was 17ish when I started this project and didn't know any better. All I knew was that I could draw sprites at offset positions, squash them, and make it look 3d. Factors like raytracing weren't considered. I may some day switch over, but we'll see.

Anyways, I'll walkthrough the code that translates the mouse position to world position:

Code:
/// <summary>
/// Translate a screen position to a world position.
/// </summary>
/// <param name="screen">XY coord with origin in top left.</param>
/// <param name="z">The world depth we are looking at.</param>
/// <returns></returns>
public static Vector3 OverlayToWorld(Point screen, float z)
{
    // As the camera position is in the center of the screen, not the top left,
    // first we adjust position by 1/2 the dimensions of the screen.
    Vector2 pos = new Vector2(
        screen.X - Main.viewport.Width / 2,
        screen.Y - Main.viewport.Height / 2);

    // Cam zoom is a multiplicative scaler of the final render;
    // perform the operation in reverse.
    pos.X /= Main.cam.Zoom.X;
    pos.Y /= Main.cam.Zoom.Y;
    
    // Find the angle from the center of the screen to the mouse pos,
    // then subtract the camera rotation to find the actual angle we're looking at.
    float angle = (float)Math.Atan2(pos.Y, pos.X) - Cinema.Rotation;

    // Find the length of the vector to the mouse pos
    float length = pos.Length();
            
    // Use the original length and the new vector to calculate the proper position
    pos = new Vector2(
        (float)Math.Cos(angle) * length,
        (float)Math.Sin(angle) * length);

    // Offset by the distance the cam is from the origin
    pos += Main.cam.Pos;

    // Return with the previously specified depth
    return new Vector3(pos, z);
}

I admit I feel pretty clever for this, but it's likely a terribly inefficient solution compared to the alternatives! Any advice on the subject would be appreciated, but I'll keep rolling either way.

So to make the tooltips above I basically went in reverse but not exactly, which is probably why they're kinda glitchy and I showed you this other code instead!

Regardless! I am very excited to have this up and running. It will help a lot with the user interface (I'll be able to label different world elements, and have targeted interaction with them), and maybe more importantly, debugging! I'll be able to see readouts for any and all variables I want, tied to their in-game object and position! I am super psyched for this tool and think it will help a lot with my rate of progress. Hell yeah!

Up next: I plan to clean up and refactor large chunks of code relating to how the camera, scripting, and game states are handled, in that order. I'll also be working on basic AI, weaponry, and player abilities at the same time. Basically trying to make more content, while improving my workflow by solving the problems I encounter along the way.

Thanks so much for everyone watching and encouraging! This project is a little bit keeping me sane right now (while also driving me crazy) and having your motivation/feedback is very helpful.
« Last Edit: November 20, 2016, 07:23:00 PM by 7heSama » Logged

Sustrato
Level 1
*


It's a good day to die.


View Profile
« Reply #11 on: November 27, 2016, 03:44:10 PM »

Hope everyone had a good thanksgiving break!

I did a little refactoring, turning some messy spaghetti code into a couple clean interfaces with better management and improving tool tips. It's still far from best practice, but getting closer.

Also, concept art:



Concept art of a Bᴏssғɪɢʜᴛᴇʀ Pɪʟᴏᴛ free-falling in the wake of a Dʀɪʟʟ. Drills are essential to the gameplay and lore of the Foregunners. They are alien technology, every one found in a wreck at Roswell, Phoenix, Maury Island, Mantell, etc; their purpose, to travel between parallel dimensions. Note that it is very dangerous for an exposed human to travel between dimensions, so realistically speaking, this Pilot is probably dead.

Pilots die a lot in Foregunners! Right now, the design is a kind of suvival-ARPG. When you die in-game, another pilot will warp in to your dimension to take their place. Who knows what they've been up to (the fact that they conveniently warp in as you die is just for gameplay's sake); they step into the shoes left behind by the choices you make as player.

I've been reading a lot of great threads on TIGSource! It's seriously inspiring. Hopefully, I can sort my code out and bring some good updates to the table. The goal is to have a playable demo by Dec. 22; it will be far from complete, but here's what I'd like to accomplish:

- Game state management (main menu, level select, game world, GUI overlays)
- Component-based GUI
- Still placeholder graphics/scripting, but a step above placeholder art

What I'm going to work on immediately is:

- Interactive tooltips
- Component-based weapons
- Threat assessment AI

Till next time!
Logged

Skydsgaard
Level 1
*



View Profile
« Reply #12 on: December 24, 2016, 03:34:29 AM »

Well, I am just an artist. I have no idea about levels procedurally generated, performance or memory cost or how you are managing your tiles. But yeah, as a minimum, I would add some kind of clean 80’s grid just to give some feedback movement to the player.



Anyway, looking forward to the playable demo! <3
Logged

Sustrato
Level 1
*


It's a good day to die.


View Profile
« Reply #13 on: March 26, 2017, 12:11:16 PM »

"Feel this forever, even when you're gone"
-- DNCE

Currently in the process of converting levels from layered .txt files to a custom binary format. Big ups to Si Robertson's articles on binary file formats, the Phantom Brigade devlog/team, and obviously everyone on Stack Overflow, MSDN, etc. for helping me learn this.

Here's the code for reading/writing binary files if anyone is interested in checking it out. Feel free to steal, but there are definitely better resources out there (as linked above!). Using good style/best practice/etc is something I would like to do better, so feedback on that would be appreciated.

Originally maps were stored in multiple .txt files. The row/column corresponded to X and Y, and the files were sequentially numbered for z-depth. A switch statement aligned each character with collision and sprite data. Not very human readable, difficult to edit, difficult to contain all the files, plus, I was running out of characters.

Now they are stored in a .grid file with a short header denoting the asset type and version number, then three bytes for axial dimensions, and the rest of the file is two bytes per tile denoting collision and sprite data.

Next I need to work on a GUI to edit maps. This will probably be difficult, but I need to work on UI stuff anyways for gameplay purposes.

Thanks for reading! Progress on this game is obviously very slow but I don't intend to give up.
« Last Edit: March 26, 2017, 12:26:22 PM by Kris with a K » Logged

rj
Level 10
*****


bad, yells


View Profile WWW
« Reply #14 on: May 09, 2017, 10:56:16 PM »

look ok i saw you said tiberian sun was one of your favorite games so you and i are going to have to fucking talk about some things
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic