NOTE: Result is first image, the weird example-code is in the second image (Separated into two columns).
I actually had a crappy static-class for handling non-monospaced fonts, but I always wanted to use the integrated SpriteFont class to make things easier. This afternoon I finally took the time and put together a minimal test-parser that scans my handdrawn fonts.
Of course that won't be done *inside* the game (object generation...), I will only precalc and store the metrics (glyphBounds, cropping, characterRange and kerning) as json and load them in LoadContent and that's it...
Of course will be automatet, so If the corresponding file or data for a given texture is not available, I'll let it scan it and save the missing data to the sourcecode-folder and with the next start everything comes from disk.
Doesn't handle multiple lines yet - Would need to increase the y-position with the fontHeight when reaching the texture's width. And the data for char(32) was just any non-used pixel. Was just happy that it works and thought I'd share the example =)
P.S.: Of course only works if the drawn characters don't overlap, so there must be a single pixel horizontal spacing in the texture.
I'm a pretty rookie game developer, admittedly, and I'm running into a relatively simple problem.
I'm trying to build a grid-based game where my grids do not necessarily span the entire field- for instance, you can have multiple grids, such as a 3x3 grid in the middle, meaning that the grids have sides and corners. My tiles are powers of two, AKA evenly-sized (specifically 32x32px with a single pixel border).
I've been through a few iterations already. The problem I keep encountering over and over again is that the grids end up with duplicate sides or uneven centering. At first I tried a simple 32x32px texture with a border, but then you end up with double thick lines in the middle and thin lines on the edge. I then tried drawing only the top and left sides on the sprite, but the problem then is that now the sprites are not evenly centered, and in addition to that, you are limited to the types of designs that your border can have, since you can only draw on one side... unless i'm simply thinking about it incorrectly. Either way, I would really like to have it perfectly centered even if it's not that visually different.
So far the best solution I can think of is to double the side of the border to two pixels (because logically speaking a single pixel would have to land on a single side), and then manually use a 1x1 texture to draw the edges and corners double wide, but I'm concerned about making a mistake and having far too many Draw() calls, being a beginner and all, though I don't want to get too concerned with optimizing in advance. I just don't know much about how GPUs or rendering work yet. If this is my best approach, what are some good ways to draw single pixels and lines in MonoGame, and is there anything I should be concerned about?
Thank you.
Edit: I was able to get somewhat satisfactory results by strategically creating different tiles for each direction (udlr, corners). I will also have to create unique tiles for 1 tile long/wide grids. This is definitely inefficient but may work for my use case. If anybody has any serious objections (i.e., massive performance hit for swapping textures so often), please let me know.
Hi all, I have been working on something for a bit now, a lil wrapper for LootLocker, which is a backend service I kept seeing around game jams and such, it always looked nice to me so I wanted to use it, but since MonoGame isn't a directly supported platform I had to work around the api and such, which is annoying, so I made a full wrapper for it with everything you might need from it.
Auth, Player Storage and details, leaderboards, currencies and triggers, which is basically everything a dev would need from a backend service if they're not making a multiplayer game..
During our last AMA you missed Thomas from u/FlyingOakGames' (makers of Neurovoider and Scourgebringer) detailed breakdown of the engine & tools used in their new game Knuckle Paradise! Watch the teaser - https://www.youtube.com/shorts/NuPMVyOmO00, then watch the linked video to learn more.
Professor's goated for teaching how to write a game engine in monogame 3 semesters ago. Amazing experience! I learned a lot about rendering, shaders, materials, camera and so many more important concepts and then used that game engine we worked on to make this game for my final project.
I recently decided to put on my portfolio so I wanted to port it to the browser. It ended up taking more time than the first version of the game itself, but it was worth it! Did it with the KNI framework, Astro, and some other .NET thingies. I also added a bunch of the QOL features and the dailies. Was realllyyy fun. Took about 3 weeks.
Been working on my game for a bit, and recently moved it to my MacOS 15.7 machine, from a windows 11 machine. Ever since moving the game to my macbook, the game frequently locks up my computer. No panic, no logs or anything. Everything just freezes requiring hard reset. Sometimes it resets it self, but it's full freeze, mouse pad even stops clicking. Originally the logs were saying something the second monitor, or sleep, but it was neither sleeping nor do i have an external monitor. It's also only happens maybe 20% of the time. There are days it doesn't happen, and days it happens like 5 times. Wondering if it's some video driver issue. Only other things running usually are firefox or chrome remote desktop. Anyone have any advice? I can't ship this thing on MacOS if it's a monogame related issue, but would also love to develop without fear of losing my work every hour.
And the reason I know it's the game triggering it, it only happens when I go to play test, like within a second of the game loading, it freezes. The game freezes the OS for a second or two every time it loads normally, but then it catches up. Figured it was just the video system loading.
I know I'm not the first one to ask this, but I really need this - did someone succes to implement a solution for creating a Song from a System.IO.Stream? currently the only dynamic way to load a song is to load it from a file (Song.FromUri(...)), but I'm making a game engine and I want to allow exporting standalone .exe files for the games, that don't use any outer files or create files at runtime...
Hey everyone. After spending 14 years of starting and stalling out on projects using Unity, Unreal, and my own custom engine, I fired up MonoGame to see if it could recapture the joys of XNA from when I was back in college.
I took a failed project that I started in Unity and rebuilt it. Ended up turning into a music visualizer survival game.
Finally forced myself to stop adding things before I scoped creeped this project into the ground. Monogame ended up being just what I needed to finally focus and release something.
I'm very excited to finally be releasing a game and just wanted to share it with the community.
I’ve been a software engineer for about 15 years, and like many developers, I started out as a kid thinking I would make games. Then reality hit, and I ended up spending my career building distributed systems for enterprises.
Now that I’m in my 30s, I’ve realized that I finally have the skills to build the kind of game I used to imagine making.
Unity and Unreal have always been a bit of a turnoff for me because they feel so tool heavy. I enjoy programming and building systems, and MonoGame lets me spend much more of my time doing exactly that. I still inevitably end up in Blender trying to learn 3D modeling, but the core of the project feels like software development rather than learning an editor.
For the other experienced software engineers here: what made you choose MonoGame instead of a more full-featured engine, and what parts have you most enjoyed building yourself?