Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
LegalPad
Oct 23, 2013

Joda posted:

I don't even know if flash stuff works on Android devices anymore. I don't know about Actionscript as a language (is it even used for anything except flash?) but flash is a dying standard and is rapidly being replaced by native features in HTML5/JavaScript.

You should probably look into Unity for just making something quick. It deploys to android iirc, but it uses C#. Alternatively, look into JavaScript and how to use it for game development (there're a couple of libraries available for this too.) It's basically the new standard for web-based games. Android development in C++ is not recommended even if you're a seasoned C++ developer.

In terms of ease of learning and facilitating a quick prototype-based development, I'd probably recommend JavaScript over Unity.

Thanks for the recommendations.
The little I did in Flash must have really hosed me up because I'm having a hard time conceptualizing making a game without working with some kind of design stage. If I do it in Javascript/HTML5, there would be a lot of overhead code in working with the 'canvas' or whatever right? Is there some kind of design platform I would need beyond a text editor?

Would Unity be easier to work with from a visual standpoint because I can load the assets right in?

My head is swimming trying to research how to approach this.

Adbot
ADBOT LOVES YOU

Tendales
Mar 9, 2012
If you really want to stay in a Flash style environment, look into Haxe, which was more or less designed as a flash replacement that can deploy to flash, html5, binary, or mobile. This might be the best way to go if you've got flash assets you want to use. Haxeflixel and Haxepunk are easy to use free libraries that can handle all the behind-the-scenes stuff for cameras, map structures, controllers, etc.

OTOH, it's still pretty niche, and if you want something with way more support and people to help you out, you can get a 2D game in Unity up and running in minutes just from watching a couple online tutorials. Plus if you want to branch into 3d in the future, it's WAY easier with unity than with haxe.

Ranzear
Jul 25, 2013

LegalPad posted:

If I do it in Javascript/HTML5, there would be a lot of overhead code in working with the 'canvas' or whatever right?

Canvas games are a dark pit of despair and flipped y-axis from which there is no return and/or avoiding writing a ton of bullshit code to do simple things like draw a sprite.

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

LegalPad posted:

Thanks for the recommendations.
The little I did in Flash must have really hosed me up because I'm having a hard time conceptualizing making a game without working with some kind of design stage. If I do it in Javascript/HTML5, there would be a lot of overhead code in working with the 'canvas' or whatever right? Is there some kind of design platform I would need beyond a text editor?

Would Unity be easier to work with from a visual standpoint because I can load the assets right in?

My head is swimming trying to research how to approach this.

Since the emphasis is on your art assets and not programming, and getting Unity to run on mobile can be a bit of a pain, I would start with something like an Easel JS demo scene, get your art in there, and extend or change it to suit your needs (check out the live edit at the bottom).

:smoobles: Quaternion question incoming :smoobles:

I'm trying to get an object to rotate the shortest way from one keyframe to the next keyframe. In order to try to understand how quaternions, inTangent, and outTangent work in legacy animations (docs), I made this demo scene. My game is about making legacy animations using a tool so I can't use Unity's mechanim tools or UI. When you click "CREATE ANIMATION" it takes the transform values of the first cone and makes it keyframe 1 and the transform values of the second cone and makes it keyframe 2, then plays the animation on the rightmost cone.

Goes the short way (rot z and w have matching signs... is this the key?)


Goes the long way (noooo)


I've tried experimenting with the outTangent and the inTangent to get it to go a certain way and no values seem to do very much. Would appreciate any ideas or insights. My math skill is even weaker than my programming skill so quaternions are a bit of a stretch atm.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

awesomeolion posted:

Since the emphasis is on your art assets and not programming, and getting Unity to run on mobile can be a bit of a pain, I would start with something like an Easel JS demo scene, get your art in there, and extend or change it to suit your needs (check out the live edit at the bottom).

:smoobles: Quaternion question incoming :smoobles:

I'm trying to get an object to rotate the shortest way from one keyframe to the next keyframe. In order to try to understand how quaternions, inTangent, and outTangent work in legacy animations (docs), I made this demo scene. My game is about making legacy animations using a tool so I can't use Unity's mechanim tools or UI. When you click "CREATE ANIMATION" it takes the transform values of the first cone and makes it keyframe 1 and the transform values of the second cone and makes it keyframe 2, then plays the animation on the rightmost cone.

Goes the short way (rot z and w have matching signs... is this the key?)


Goes the long way (noooo)


I've tried experimenting with the outTangent and the inTangent to get it to go a certain way and no values seem to do very much. Would appreciate any ideas or insights. My math skill is even weaker than my programming skill so quaternions are a bit of a stretch atm.

Quaternions are terrible for seeing what the values do. Easiest thing is to have your tooling also give you the rot matrix or yaw/pitch/roll and convert it for you.

To solve your problem with rotations going the wrong way, check to see if rotating to X, X+2pi, or X-2pi results in a shorter rotation. There's probably something clever you can do to determine that without bothering, but for an offline tool it's not worth my time to look up or derive for you and likely not yours either.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
I'm assuming that you're using slerp to interpolate between the quaternions. If so, you need to ensure that the two quaternions are in the same hemisphere, a.k.a. that their W's are either both positive or both negative, otherwise you get that problem.

(x,y,z,w) and (-x,-y,-z,-w) represent the same transformation, so all you need to do is see if the W signs match, and if not, negate one of the quaternions.

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

OneEightHundred posted:

I'm assuming that you're using slerp to interpolate between the quaternions. If so, you need to ensure that the two quaternions are in the same hemisphere, a.k.a. that their W's are either both positive or both negative, otherwise you get that problem.

(x,y,z,w) and (-x,-y,-z,-w) represent the same transformation, so all you need to do is see if the W signs match, and if not, negate one of the quaternions.



That works perfectly!! Thank you very much :)

22 Eargesplitten
Oct 10, 2010



Is there a way to disable interaction with a certain trigger for a certain period of time? Basically I've got a grid of triggers, and the object is always traveling along one. The problem is, when it hits a second one and decides to turn onto it, it triggers OnTriggerEnter2D again, so it's just spinning in a circle endlessly. What I want to do is disable that trigger for that particular object for a certain amount of time (maybe 1 second). Is this possible?

It shouldn't be doing that anyway since it should only have a 1 in 4 chance in turning, but I don't think that's related.

E: Well, I tried setting it to a layer that ignored the layer the triggers are on and I tried setting IgnoreCollision2D with the trigger object, and they're still just going around in circles.

Nevermind, figured it out. The trigger is hitting too early, so they end up turning straight into an obstacle, which tells them to turn again, which sends them into another obstacle, repeat ad infinitum.

22 Eargesplitten fucked around with this message at 01:23 on Oct 5, 2016

Feral Integral
Jun 6, 2006

YOSPOS

Anyone seen/played xcom2?

Played it for the first time myself just yesterday: On your 'base' screen you get this amazing effect where when zoomed out, all your poo poo looks like it's pixel graphics, but when zooming in it almost seamlessly transitions to 3D. For example: https://www.youtube.com/watch?v=8NzIpYn5qvA&t=270s.

Anyone know if there's a name for this technique, and where I could get more information about implementing it?

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
Maybe I just can't tell from the video but I don't think they're doing anything other than zooming in on a 3D scene. Maybe they're enabling/disabling some sort of screen shader, enabling more animations on the rooms, and changing LOD models but I'm not seeing anything real crazy there.

22 Eargesplitten
Oct 10, 2010



Is there a way to make it so rigidbodies can't push each other, just collide? Or do I need something else for that? I've tried setting mass to 0, but that just puts it down to .0001. I just want to be able to register when they hit each other, but if two end up pushing on one, it moves the one.

E: If you put Destroy(gameObject) in a method, can you put another line in there after that, or will it cut out anything after the destroy command? What I want to do is destroy something, then trim the list it's in to size now that it's gone. Could I call a ShrinkList() method after Destroy(gameObject)?

22 Eargesplitten fucked around with this message at 19:53 on Oct 5, 2016

BirdOfPlay
Feb 19, 2012

THUNDERDOME LOSER

22 Eargesplitten posted:

Is there a way to make it so rigidbodies can't push each other, just collide? Or do I need something else for that? I've tried setting mass to 0, but that just puts it down to .0001. I just want to be able to register when they hit each other, but if two end up pushing on one, it moves the one.

Sounds like you'll need to mess with the objects collision interaction via OnCollisionEnter(). You'll need to wire it up so that only one of the two colliding Rigidbodies ends up having a force/impulse applied to it. Is this for a box pushing type scenario?

quote:

E: If you put Destroy(gameObject) in a method, can you put another line in there after that, or will it cut out anything after the destroy command? What I want to do is destroy something, then trim the list it's in to size now that it's gone. Could I call a ShrinkList() method after Destroy(gameObject)?

According to the Unity docs Destroy() really just marks it for deletion by the engine, while DestroyImmediate() will immediate delete the object. Objects marked with Destroy will be removed after the Update loop but before rendering. It should be noted that Unity recommends against DestroyImmediate(), because it could cause problems for destroying an object at an unsafe time.

So, yes, you're safe to continue working with the object following a Destroy() call.

22 Eargesplitten
Oct 10, 2010



Cool, that will make cutting down the list much easier.

It's not box pushing, it's pathfinding. I'm using what's basically a weighted drunkard's walk. When two enemies run into each other, the one or both who is/are facing into the other should go "oops, I need to turn around and go the other way." The thing is sometimes the collision pushes one out of alignment and that screws everything up.

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀

Feral Integral posted:

Anyone seen/played xcom2?

Played it for the first time myself just yesterday: On your 'base' screen you get this amazing effect where when zoomed out, all your poo poo looks like it's pixel graphics, but when zooming in it almost seamlessly transitions to 3D. For example: https://www.youtube.com/watch?v=8NzIpYn5qvA&t=270s.

Anyone know if there's a name for this technique, and where I could get more information about implementing it?

Just looks like the camera moves in + maybe an fov change.

Lork
Oct 15, 2007
Sticks to clorf

22 Eargesplitten posted:

Cool, that will make cutting down the list much easier.

It's not box pushing, it's pathfinding. I'm using what's basically a weighted drunkard's walk. When two enemies run into each other, the one or both who is/are facing into the other should go "oops, I need to turn around and go the other way." The thing is sometimes the collision pushes one out of alignment and that screws everything up.
There's also an OnDestroy() method which is the ideal place to do this kind of cleanup because it accounts for situations where, say, you destroy the gameobject from somewhere else without remembering that you need to clean up after it.

BirdOfPlay
Feb 19, 2012

THUNDERDOME LOSER

22 Eargesplitten posted:

Cool, that will make cutting down the list much easier.

It's not box pushing, it's pathfinding. I'm using what's basically a weighted drunkard's walk. When two enemies run into each other, the one or both who is/are facing into the other should go "oops, I need to turn around and go the other way." The thing is sometimes the collision pushes one out of alignment and that screws everything up.

Oh, have you tried making the RigidBodies kinematic?

Mr Shiny Pants
Nov 12, 2012

Dr. Stab posted:

Just looks like the camera moves in + maybe an fov change.

In combination with some LOD models.

everythingWasBees
Jan 9, 2013




Does anybody have some good Unity tutorials? Like, preferably one that gives good best practices and stuff.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

everythingWasBees posted:

Does anybody have some good Unity tutorials? Like, preferably one that gives good best practices and stuff.

Nope. Just build some stuff and use the same best practices as every other programming thing.

You'll figure out the unity specific stuff when it bites you or people in one of the threads laments it.

Tiler Kiwi
Feb 26, 2011
I got the book Unity In Action. I've only read the first few chapters, but it's pretty approachable.

You could probably get by just by messing around with Unity, though. I'm a baby and kind of like having a good guide on hand, and I really don't like youtube tutorials compared to an actual book.

Stick100
Mar 18, 2003

everythingWasBees posted:

Does anybody have some good Unity tutorials? Like, preferably one that gives good best practices and stuff.

https://www.udemy.com/unitycourse/

Is a good course for the 1/3 or so I went through. They focus on best practices and work up from the start. Right now it's $195 but often can be had for $20-$40 at that price it's a good deal for $195 it's probably overpriced.

Unperson_47
Oct 14, 2007



Well, I've decided to try to tackle multiplayer which I've never attempted before. I'm kind of mystified as to where to even begin so any help would be appreciated.

I want to make a simple online game where people can connect to one server which will have thousands of really simple objects represented by a handful of pixels. Players should be able to manipulate these objects and this should impart changes that everyone will see. Think of that old flash game where players could move refrigerator alphabet magnets around. That's basically what I'm doing except some objects will have their own behavior.

Is this something I can easily do with Unity via HTML5? (as well as some kind of server-side system to manage the global state?)

Does anyone have any suggestions on where to begin? Am I getting in over my head? The only server-side stuff I ever did was using PHP and MySQL back in the day and that was a while ago.

Unperson_47 fucked around with this message at 14:36 on Oct 7, 2016

Reharakhti
Oct 9, 2012

Secretly Sekhmet

Stick100 posted:

https://www.udemy.com/unitycourse/

Is a good course for the 1/3 or so I went through. They focus on best practices and work up from the start. Right now it's $195 but often can be had for $20-$40 at that price it's a good deal for $195 it's probably overpriced.

I'd also recommend this course. Started it last year with no coding knowledge and got through about half of it before taking my own path.
A quick google for coupons gives a 95% discount on their courses, the one linked above shows up for 10 Euros in the top row for me: https://www.udemy.com/courses/?pmtag=OCT1202&siteID=Qnwphc0eKlk-VwFvcZvUf4yoLOUD2.cB2A&LSNPUBID=Qnwphc0eKlk

ZombieApostate
Mar 13, 2011
Sorry, I didn't read your post.

I'm too busy replying to what I wish you said

:allears:

Unperson_47 posted:

Well, I've decided to try to tackle multiplayer which I've never attempted before. I'm kind of mystified as to where to even begin so any help would be appreciated.

I want to make a simple online game where people can connect to one server which will have thousands of really simple objects represented by a handful of pixels. Players should be able to manipulate these objects and this should impart changes that everyone will see. Think of that old flash game where players could move refrigerator alphabet magnets around. That's basically what I'm doing except some objects will have their own behavior.

Is this something I can easily do with Unity via HTML5? (as well as some kind of server-side system to manage the global state?)

Does anyone have any suggestions on where to begin? Am I getting in over my head? The only server-side stuff I ever did was using PHP and MySQL back in the day and that was a while ago.

I haven't messed with it since like Unity ~4.3, but trying to do anything fancy with multiplayer in Unity was super painful. If you wanted to make a P2P game that didn't do much more than track position/rotation and weren't worried about cheating or latency, it was probably ok, but you'd still be writing basically everything by hand. I never got around to it, but if you wanted a dedicated server it seemed like you had to write it from scratch as a separate project and then try to keep it up to date with whatever changes you make to the actual game. Basically I hated it so much I switched to UE4. Maybe it's gotten better since then, I don't know. Keep in mind this was also my first real stab at a multiplayer game so it could just be sour grapes, but UE4 has been so much more pleasant to work with.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Unperson_47 posted:

Well, I've decided to try to tackle multiplayer which I've never attempted before. I'm kind of mystified as to where to even begin so any help would be appreciated.

I want to make a simple online game where people can connect to one server which will have thousands of really simple objects represented by a handful of pixels. Players should be able to manipulate these objects and this should impart changes that everyone will see. Think of that old flash game where players could move refrigerator alphabet magnets around. That's basically what I'm doing except some objects will have their own behavior.

Is this something I can easily do with Unity via HTML5? (as well as some kind of server-side system to manage the global state?)

Does anyone have any suggestions on where to begin? Am I getting in over my head? The only server-side stuff I ever did was using PHP and MySQL back in the day and that was a while ago.

Read up on classic networking stuff. The Quake 3 network model might be usable for you, but there are breakdowns of tons of very successful sync algorithms. Fabian Sanglard has a really good overview of the quake model. If you'd rather do something more RTS-ish with lots and lots of things, there's an age of empires net code breakdown somewhere; I think there's one for Starcraft, too.

For anything not dead-simple you're going to need to implement the backend yourself and write an interface for whatever socket protocol into your game. It's not exceedingly difficult to do (though optimizing can be very difficult and debugging isn't always trivial). It does require understanding exactly what you want to do and carefully organizing things before you really dig into it.

I like the Q3 model because of how dead simple it is. It's a reasonable place to start if you're worried about not understanding what's going on. But depending on how active your units are, it may not be suitable..

Fano
Oct 20, 2010
I'd be interested in reading up on the quake model as me and some friends are about to embark into some multiplayer development for a prototype we want to make.

Here is the article about age of empires, it's a really good read: http://www.gamasutra.com/view/feature/131503/1500_archers_on_a_288_network_.php

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

leper khan posted:

Read up on classic networking stuff. The Quake 3 network model might be usable for you, but there are breakdowns of tons of very successful sync algorithms. Fabian Sanglard has a really good overview of the quake model.
Shameless plug: I wrote up a document on the high-level gameplay networking of Quake 3, which covers a lot of the important intricacies that Fabian's writeup misses, like how time it handles timing, prediction, packet loss, and how conflicts between the local prediction and the server are (implicitly) resolved, and some commentary on the challenges of translating its specific approach to more modern games.

https://www.dropbox.com/s/nx44m53tcgharp4/q3net.pdf

I think people focus on the low-level communication a bit too much when what's really important for making an online game feel responsive is understanding the high-level techniques that are used to shift lag to where it's less noticeable. There is no magic bullet for that either, it's all completely ad-hoc and about what works for your specific game.

I'd consider Bungie's GDC talk on Halo: Reach's networking mandatory viewing for anyone working on a real-time online game, to understand how problems should be approached:
http://www.gdcvault.com/play/1014345/I-Shot-You-First-Networking

OneEightHundred fucked around with this message at 17:22 on Oct 8, 2016

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Does any body know if there's a way with Unity's vertical and horizontal layout groups to insert GUI elements into the middle of them? All I can really seem to do is append.

Stick100
Mar 18, 2003

OneEightHundred posted:

Shameless plug: I wrote up a document on the high-level gameplay networking of Quake 3, which covers a lot of the important intricacies that Fabian's writeup misses, like how time it handles timing, prediction, packet loss, and how conflicts between the local prediction and the server are (implicitly) resolved, and some commentary on the challenges of translating its specific approach to more modern games.

https://www.dropbox.com/s/nx44m53tcgharp4/q3net.pdf

I think people focus on the low-level communication a bit too much when what's really important for making an online game feel responsive is understanding the high-level techniques that are used to shift lag to where it's less noticeable. There is no magic bullet for that either, it's all completely ad-hoc and about what works for your specific game.

I'd consider Bungie's GDC talk on Halo: Reach's networking mandatory viewing for anyone working on a real-time online game, to understand how problems should be approached:
http://www.gdcvault.com/play/1014345/I-Shot-You-First-Networking

As a start also look at this.
https://www.youtube.com/watch?v=vTH2ZPgYujQ
This describes the network techniques in Overwatch. I think they do an amazing job of mixing prediction and client authoritative actions along with server authoritative actions.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

Does any body know if there's a way with Unity's vertical and horizontal layout groups to insert GUI elements into the middle of them? All I can really seem to do is append.

You just need to reorder the siblings.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

leper khan posted:

You just need to reorder the siblings.

Hmm this is some A+ Good poo poo right there. I was able to refactor out this parallel List I was using to track which buttons I had in the vertical layout.

Ranzear
Jul 25, 2013


This is a really nice writeup. I'm rerolling my Caliber netcode into EZ right now with an eye on resolving multiple client inputs per server frame.

Assuming I don't bludgeon my collision detection for another few hours...

Pilchenstein
May 17, 2012

So your plan is for half of us to die?

Hot Rope Guy

Stick100 posted:

This describes the network techniques in Overwatch. I think they do an amazing job of mixing prediction and client authoritative actions along with server authoritative actions.
This is really interesting but why are they behind a chest-high wall? They look like they're on Sesame Street. :v:

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

OneEightHundred posted:

I think people focus on the low-level communication a bit too much when what's really important for making an online game feel responsive is understanding the high-level techniques that are used to shift lag to where it's less noticeable. There is no magic bullet for that either, it's all completely ad-hoc and about what works for your specific game.

I'd consider Bungie's GDC talk on Halo: Reach's networking mandatory viewing for anyone working on a real-time online game, to understand how problems should be approached:
http://www.gdcvault.com/play/1014345/I-Shot-You-First-Networking

This is a great talk. I had no idea that player perception would be that important. I thought it would be more of a "it's either all laggy or it's not" when in reality it's more "by necessity a bunch of stuff needs to be laggy / desynced so prioritize what matters".

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Pilchenstein posted:

This is really interesting but why are they behind a chest-high wall? They look like they're on Sesame Street. :v:

because they use the table for props when describing netcode actions

Blue Footed Booby
Oct 4, 2006

got those happy feet

I'm working on a crappy Doom-ish engine in C# using XNA, inspired by this madness right here:
.
Click for source. Dude did that in assembly, running on a TI-83+ graphing calculator. It's a shame he stopped updating his blog. :allears:

Anyway, I started out with camera code and a simple, hard-coded level. Got an overhead map rendering to check the level and player movement, then started on the "3D" view. I wanted it to just draw lines where the base of the walls will go to check for problems with the 3d projection before I start doing all the pseudo-3d stuff, like calculating wall height and actually drawing things. I'm literally just using GraphicsDevice.Viewport.Project to get the start and end points into screen space.

All the lines but the ones labeled 0 and 4 are drawing correctly. :saddowns: Note that the messed-up lines meet at exactly the vanishing point of all the parallel bits.

The white lines and the little balls around the vertices are done using a debug shape library I had lying around. The library isn't viable for actually rendering the full level. Point is they're all drawing correctly despite using the same view and projection matrices, as well as the same coordinate variables I'm feeding into the Project call.

It seems the projection is messing up lines that have more than some specific percentage of their length offscreen. I back up a little bit and suddenly everything works:

My math skills are pretty weak, so I figure I'm probably doing something stupid. Finally decided to post here and pray for "fooble your narble matrix, dummy."

Blue Footed Booby fucked around with this message at 23:25 on Oct 9, 2016

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Blue Footed Booby posted:

I'm working on a crappy Doom-ish engine in C# using XNA, inspired by this madness right here:
.
Click for source. Dude did that in assembly, running on a TI-83+ graphing calculator. It's a shame he stopped updating his blog. :allears:

Anyway, I started out with camera code and a simple, hard-coded level. Got an overhead map rendering to check the level and player movement, then started on the "3D" view. I wanted it to just draw lines where the base of the walls will go to check for problems with the 3d projection before I start doing all the pseudo-3d stuff, like calculating wall height and actually drawing things. I'm literally just using GraphicsDevice.Viewport.Project to get the start and end points into screen space.

All the lines but the ones labeled 0 and 4 are drawing correctly. :saddowns: Note that the messed-up lines meet at exactly the vanishing point of all the parallel bits.

The white lines and the little balls around the vertices are done using a debug shape library I had lying around. The library isn't viable for actually rendering the full level. Point is they're all drawing correctly despite using the same view and projection matrices, as well as the same coordinate variables I'm feeding into the Project call.

It seems the projection is messing up lines that have more than some specific percentage of their length offscreen. I back up a little bit and suddenly everything works:

My math skills are pretty weak, so I figure I'm probably doing something stupid. Finally decided to post here and pray for "fooble your narble matrix, dummy."

Any reason you can't just cull at the vanishing point?

Blue Footed Booby
Oct 4, 2006

got those happy feet

leper khan posted:

Any reason you can't just cull at the vanishing point?

Sorry, I was unclear. That green line in the second pic bottom left is where the green line with the 0 next to it in the first pic should have been, just with the camera moved back. It should match that overlayed map, the gray box with the red circle thing (that's the camera). The start point is supposed to be behind the player and to the left in the first pic, but instead it ends up way off to the right and up. Lines 0 and 4 are not supposed to intersect.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Blue Footed Booby posted:

Sorry, I was unclear. That green line in the second pic bottom left is where the green line with the 0 next to it in the first pic should have been, just with the camera moved back. It should match that overlayed map, the gray box with the red circle thing (that's the camera). The start point is supposed to be behind the player and to the left in the first pic, but instead it ends up way off to the right and up. Lines 0 and 4 are not supposed to intersect.

It looks like things freak out for you whenever your camera moves past a point? Maybe you aren't correctly handling negative offsets from your camera.

Adbot
ADBOT LOVES YOU

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost
I'm having an issue with font-rendering. I'm building a hobby project on top of SDL and using SDL_ttf for font support. So far I'm mostly just testing out various graphical aspects and I'm finding that SDL's font-rendering seems really... shabby. This surprises me because I know SDL is the underlying layer for plenty of games out there and Googling around I haven't been able to find anyone having the same issues I have so maybe I'm just missing something obvious.

For comparison here's A taken from the Monaco font on the Mac at 24 pt, as rendered by the OS:



Here's SDL rendering the same glyph in Solid mode:



And finally here's SDL rendering the glyph in Blended mode:



Solid obviously isn't doing any aliasing so maybe the blockiness is expected but the blended mode still doesn't look anything close to the quality of the actual font; the aliasing, for example, is SUPER obvious. I've also thrown various hinting settings at the problem but they generally make things worse, especially at smaller point sizes.

When I compare this to games such as Caves of Qud, Brogue, or Dwarf Fortress the glyphs look crisp and beautiful. Am I missing some dumb setting? Is this really all SDL is capable of? Does everyone get around this by generating a font atlas using some 3rd party tool? It seems like it should be possible to render high-quality fonts at runtime but this is all new to me.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply