#monogame-and-libgdx-dev

1 messages · Page 3 of 1

hot hazel
trail cradle
#

hey guys

#

wait

#

wrong chat

#

my bad

raw warren
#

My dudes, I cant instal monogame directly on Visual Studio

#

Halp pls

hot hazel
#

gonna need more details

hidden shell
#

Hello, I'm having trouble creating a deterministic, fixed timestep game loop.
Here's a pastebin for how I'm trying to limit my # of physics steps to 15 per second: https://pastebin.com/TgVyDvib

The code displays the ticks per second to console every second.
What I expect is for it to always display 15. However, sometimes the ticks per seconds is 16 instead of 15.
Is the reason it's sometimes running an extra update per second due to rounding issues? I can't seem to figure it out

lament gyro
#

I'd asume some float rounding issues too.

#

you defenetly suffer from precision loss. Maybe do something like devide the System time with your time step.

raw warren
quiet ibex
#

@hidden shell its impossible to guarantee 15 updates per real second. fixed timesteps only guarantee that each step has the same length and it pauses between steps or run extra steps to keep it roughly in sync with the real time

#

the virtual time is what's updated in fixed increments

sand pumice
#

any good tutorial for monogame devs

hot hazel
#

look up xna tutorials

sand pumice
#

thanks

lament gyro
#

I know "don't ask" but, has someone experience with Aether.Physics2D?

flat osprey
#

Hi all, small problem, Was hoping somebody could help with. I made a dictionary<string, int> to hold player stats. Strings for the names of a stat and the int for the value of the stat. How would I go about modifying the dictionary values from another dictionaries<string, int> values? Thanks

quiet ibex
#

@flat osprey dictionary["foo"] = bar;

#

but are you sure you want stats in a dictionary? you need to attach logic to them or they'll be useless

#

so unless you need a data-driven map between stats and logic, it seems more logical to make strongly typed stats

flat osprey
#

Yeh maybe i'm going about it the wrong way, I thought I could just use dictionaries to hold each races, class and players stats then modify the players values where keys match the race / class 's key

quiet ibex
#

well you could, but you wouldn't get value from the dictionary if the number of items in it didn't differ a lot between objects

flat osprey
#

Mind if I pm just show what i'm doing as to not spam here?

quiet ibex
#

so why not make a Race and Occupation class? they could then be referenced to define a Hero class for instance

#

might as well put it here, someone else might learn something

flat osprey
#

Well yeh, I made race classes and "class(like rogues, mage ect" classes that have 6 stats, Rather than running through them all to add to the players I wanted to store them in a collection so I could just run a loop when modifying the players stats

quiet ibex
#

ok, sounds like you've defined new classes where you really just needed new data

flat osprey
#

So I want the player to have these stats all set to 0 then if they choose to be a human then all the human modifiers are applied and then they can continue to choose a race and then thats use to modify them

quiet ibex
#

you can probably define 1 class to cover rogue/mage/etc

flat osprey
#

Well I made a race class and a classType class, Then with each race and class I made new classes than inherit from them because later I want to add more stuff to each of them, abilities ect..

quiet ibex
#

i wouldn't inherit from them until it proved necessary

#

you want to focus on the data when designing a class hierarchy, much like when normalizing a database

#

from what i've heard so far, you have at least 3 classes. Race, ClassType(would swap this for Occupation to make the naming clear) and Ability

#

you might also want 2 Modifier classes, one for additive modifiers and one for multiplicative

#

and you'll need a class that describes the actual ingame entity, i usually name it Hero to avoid conflicts with Player(usually useful for controller mappings, etc.) and Gamer(often used for steam integrations and the like)

#

i also tend to have an Enemy class and have both it and the Hero inherit from an abstract Actor that's the base class for anything interactible

#

the actor could then contain all the logic needed to calculate effective stats from bonuses and modifiers

flat osprey
#

I get what you're saying but I don't know what way to handle the stats for each race ect.. What collection would be best for this situation?

quiet ibex
#

doesn't really matter, you're probably going to pick the race from a list in a menu, so an array would work fine

#

i'd define the races in a csv file for simplicity, that way they diff nicely in source control and you can do mass-edits in excel

#

CsvHelper can do the parsing in a couple of lines

flat osprey
#

So for example just give the human an int array0-5, How would I pick out the stat though, Like I'd have to know what cell each attribute is supposed to be, This is why I was trying to use dictionaries because the key can be the name and value is well.. the value

#

Ah

quiet ibex
#

i'd just put the base stats as columns, which means the race class gets a property for each

flat osprey
#

See this isn't supposed to be anything big, Just a small console game so I can practice programming.. Just realised.. Why not just create a database lol ffs

#

Appreciate you taking the time to help bud 🙂

quiet ibex
#

yea, the csv files essentially becomes tables in a database. but there's a big advantage to using them over an actual database, since they diff nicely in source control

#

so you can do branches testing out balancing fixes and then cleanly merge them without conflicts

pseudo sigil
#

Hey folks! I have a quick question. I'm writing a game in monodev and it's an online multiplayer type deal. Does anyone have any good links on server-side collision? Any help would be much appreciated, I haven't been able to find much personally.

quiet ibex
#

@pseudo sigil its no different from any other type of collision detection

sturdy prairie
#

how inefficient is it to make a draw call using a texture atlas like:

#

sb.Draw(texture_atlas, hitbox, texture_atlas.GetByID(1), Color.White);

#

as opposed to making a method with the texture_atlas that creates a texture from a selected region?

hot hazel
#

the sb.draw would be way more efficient if im understanding you correctly

sturdy prairie
#

well both are sb.draw

#

so I'm not sure which one you're talking about

hot hazel
#

what do you mean 'creates a texture from a selected region'?

sturdy prairie
#

I mean like

#

so the texture atlas is a giant Texture2D

#

I would have a method that looks like this

public Texture2D GetTexture(Rectangle source)
{
    //code that takes texture_atlas and returns a new texture that is the region implied by the rectangle
}```
#

does that make sense?

#

like it crops out the section of the texture atlas and makes a new texture from it

hot hazel
#

my point is in monogame

#

new textures would be individual pieces of gpu memory

#

spritebatch, hence the name, batches draw calls i believe only by texture

#

so if you are switching textures, you lose all benefit

#

that is the purpose of the sourceRectangle in SpriteBatch.Draw

sturdy prairie
#

so it would take less memory by certain

#

what about gpu power though?

hot hazel
#

if you create two textures

#

when you draw something it has to bind that texture

#

then if you wish to draw a second texture it has to bind that

#

(in addition those are multiple draw calls)

#

modern dx/gl can do bindless textures, but i dont think monogame supports that and i dont know enough to talk about that

#

its basically no different from rendering a 3D mesh with a texture

#

the reason atlases exist is to be faster and smaller than individual textures

sturdy prairie
#

so hands down it's faster

#

awesome

#

thank you!

hot hazel
#

also easier

sturdy prairie
#

definitely

#

thanks @hot hazel

restive tapirBOT
#

Osuology gave karma to CobaltHex

hot hazel
#

anyone have experience with debugging opengl shaders for monogame? getting program crashes when certain shaders run, and theres no debug output

hot hazel
#

figured it out. unless im doign something special, one cannot have more than one position per vertex

quiet ibex
#

you can have multiple uv coordinates and other features, but multiple positions makes no sense

hot hazel
#

Dx supports them, I was using for misc vertex data

#

I guess the question is should I put the stuff in a texture instead

surreal cobalt
#

ok so this sounds weird but I want to have a 3d rendered item in a 2d space

#

like, it's only a visible difference to the viewer

hot hazel
#

Everything on a screen is 2d

#

Gonna need more details of what you want

surreal cobalt
#

so for example

#

floors and stuff are 2d

#

but walls are 3d

#

like pretty much everything but walls are 2d

#

actually I'm just gonna figure stuff out on my own and be less dumb with questions

flat orchid
#

hello

#

i am interested in the ways of the monogame™️

#

i've seen some few code bits and some unity knowledge transfers over to here

#

is it true?

#

do the same barebones rules mostly apply to both

hot hazel
#

monogame is only a framework

#

so while it does provide some things like a simple model renderer and spritebatching it doesnt require you use them and they are otherwise pretty barebones

#

it doesnt really dictatate how you build anything

#

so anything you did in unity you'd have to do in monogame

#

but you'd also have to do most of the stuff unity did for you

raw warren
#

@flat orchid I prefer Monogame over Unity because I have so much more control over my project. A big downside is that there’s no GUI. It’s just code

#

So it’s up to what you prefer

flat orchid
#

Wdym there's no GUI?

#

@raw warren

#

No integrated UI library?

raw warren
#

No no

#

There’s no gui for the person working on it. Like how Unity has its workspace. You just type code into your IDE (I recommend VS). You don’t drag and drop assets or anything of that sort

#

Kyle Schaub has a great tutorial on Udemy that covers both C# and MonoGame

#

Hope that helps @flat orchid

#

Keep in mind that MonoGame is primarily for 2d

#

Unity is better for 3d, but not so great for 2d

hot hazel
#

you can use monogame for 3d no prob

#

again, you'll be doing 90% of the work yourself however (or find a library)

raw warren
#

Well yeah

#

It’s just more efficient to use Unity

hot hazel
#

i wouldnt call it efficient

#

just easier

gray matrix
#

hey guys i just got started with MonoGame this weekend, are there any good tutorials for how to change scenes? like from splash screen to main menu?

hot hazel
#

monogame/etc dont dictate anything about how you do that

#

e.g. my game does not use scenes

#

so its up to whatever library you're using really

quiet ibex
#

@gray matrix what you're looking for is documentation on how to manage game states. A simple version would be having a class for each state(scene) and call update/draw on it through the Game1 class

#

the update method could then return a string/enum indicating the next state to switch to and then do a switch statement that swaps out the active state in the beginning of Game1.Update

#

its important that you only swap states in the beginning of update though, otherwise you might end up drawing a junk scene that hasn't been updated yet

gray matrix
#

wait what? are you saying i should be using the same Game1 class to render ALL my stuff with just different game states?

hot hazel
#

in my game i have a map class thats basically the game renderer

#

it itself is just a UI component

#

my main class renders the UI and the UI can update what UI is drawing

#

so they UI could be menus, the game, the editor, etc

raw warren
#

Long life libgdx...

jolly sail
#

just realized this chat isn't for unity/c# lol

unborn ibex
#

What would you say are some things that could be improved in libgdx?

hot hazel
#

This is not a channel for advertising

raw warren
#

@hot hazel Sorry I didnt know.

raw warren
#

hello guys

#

any libgdx clevermind?

dusky wraith
#

!justask

restive tapirBOT
raw warren
#

Hey guys! I have a question related to Monogame and Unity, I thought asking here would be the best place, do let me know if it's not :P

I am a decent programmer with a decent background and I recently started my own game project. Game development terms and structure is not unknown territory for me, however it is my first real game project ever, while intimidating I still feel confident about it 🙂 We're making a multiplayer 2d game with a top-view camera.

As the lone programmer of the project, as of right now (In the process of getting a second one), I am faced with quite a difficult question which is "Should we use Unity or something like Monogame?". I've read alot of articles, reddit posts and messed around with both Unity and Monogame. However, I'd like to get a more direct input with my situation in mind.

We've been using Unity for the past month or two, however my feeling is that Unity is taking care of a lot of things for me in a way I don't necessarily like, but also brings alot of tools to facilitate the workflow between programmers and artists as well as making things easier for me. As I'm working with pixel artists mainly using Aseprite, using Unity's built-in tools to process spritesheets and create animations has been a charm as we were able to quickly see results in a somewhat playable state.
While this aspect is great, as a programmer, I'm feeling forced to follow Unity's pattern which I don't necessarily like and Monogame definitely allow me to do whatever the hell I want and ultimately, gives me a lot more control as to what's going in the game compared to having to work with Unity's pre-made abstraction.

While that last paragraph would totally convince me to use Monogame over Unity, my main concern is the workflow between programmers and artists and the overall additional dev time required if I go with the monogame way. What is your guys opinion on that? Have you ever been faced with this situation or ever thought about it?

Thanks 🙂

#

A good analogy I came up with while thinking about this whole thing was "Do we want to use a lego box with pre-made parts that we only need to connect together or do we want to take the massive box of regular legos"

cold pilot
#

is it possible to do webapi calls using monogame? trying to figure out if I can port some server stuff from gms2 to monogame

quiet ibex
#

@raw warren depends on the game, it's possible to have monogame be the quicker implementation option. but you do need to know what you're doing

#

and given that you're looking for a second programmer and asking this question, you probably don't

raw warren
#

That's quite the harsh answer to reply with "You need a second programmer so you don't know what you're doing"

quiet ibex
#

unity is no walk in the park either though. it takes strong management and a disciplined team to work efficiently with it

raw warren
#

And the reason i'm getting a second one is because I can't do all the work alone honestly, a second mind to think about things and figure out stuff as we go on is always better

quiet ibex
#

that's not what i meant, i was commenting on the fact that you're looking for a programmer and you don't have the answer to the questions posed here

raw warren
#

Ah! I understand now, sorry about that assumption.

#

With that aside though, I agree, Unity is no walk in the park either, I don't expect Unity to be easier in fact.

quiet ibex
#

its also very important that you get the right person for the job, or adding another head is only going to slow you down

#

conversely it also means you need the skills to work effectively with a team

raw warren
#

Which is understandable, and I totally agree. I'll keep that in mind for sure. If we take the second programmer out of the equation however, what is your take on my concerns? Would you recommend one over another?

quiet ibex
#

for a solo 2d project i'd lean towards monogame, simply because you can get stuff done well in it far quicker

#

unity is better suited for teams of 5-10 ppl

raw warren
#

Interesting take, I never thought about the team size being a factor of what to choose honestly. I do have a couple people with me focusing on art since the project will require a lot, with that in mind, Unity would be a wise choice to keep that workflow clean I assume. My main concern however, since this will be a learning process for me on making an actual game (I've only made mods for existing games so far), is that using Unity may not allow me to fully understand how my game would work and not entirely having control on it.

#

I feel like this is a decision between "Controlling my code" and "Having great tools out of the box"

quiet ibex
#

your artists shouldn't be directly interacting with the engine while they work. The should be sending their assets into the pipeline and the rest is up to you pretty much

#

unity doesn't have "great tools" it has lots of "good enough" tools. which is why you can work quicker with monogame, if you know what you're doing

#

unity was designed around a process where decisions are made ahead of time in a meeting, followed by 1 or more teams spending a day or 2 implementing the decision into the game. That's not a quick workflow for a small team

raw warren
#

Now that you mention it, I do see that process in Unity now, hence why I felt like the code I was writing wasn't really "satisfying" if that makes any sense. I do see the upsides of Monogame alot more now, when starting out I assume I will write a lot of code to get the game working but in the long run, implementing new stuff would be easier since all of the code will be for my game and only my game compared to Unity which targets "A game in general". Correct me if i'm wrong

#

And "Good enough" tools is indeed the right term 😛

quiet ibex
#

well monogame just brings you to a lower level of abstraction, so you can implement your game using conventions and policies as opposed to hand-tweaking individual attributes

#

which means 1 man can do what it normally takes 10 people to do. as long as he knows what he's doing

#

but it also means you can't throw resources at a problem to make it go away

raw warren
#

That makes sense! Thanks for your insight, it was very helpful, I know what I'll be studying from now on 🙂

#

thanks @quiet ibex

restive tapirBOT
#

Raphy gave karma to Ragath

raw warren
#

I'm definitely open to more opinions should anyone else want to throw their 10 cents as well 🙂

hot hazel
#

2 cents?

#

following along ragath's statement

#

unity provides a lot of things for you

#

however if you want to do things differently, you're fighting unity

#

monogame does less for you, so theres less to fight

#

so it really depends on if unity works the way you want it to

raw warren
#

Thanks @hot hazel

restive tapirBOT
#

Raphy gave karma to CobaltHex

raw warren
#

how to change window size? (libGDX)

lone radish
#

I'm working on a space game, I have a problem with the planets and the star moving during warp. They both use the same class for movement but somehow only the first of them that's being updated moves

lone radish
#

I fixed it

raw warren
#

how to change window size? (libGDX)
@raw warren buy 4k screen

#

@raw warren buster

distant perch
raw warren
#

@distant perch HOW?

#

i need example, i really dumb in this damned api

distant perch
#

your talking about the size of the window when running as a desktop app, right?

raw warren
#

yes

#

but i want create app for android

distant perch
#

so you probably have some Lwjgl Launcher class that looks a bit like that:

public class Lwjgl3Launcher {
    public static void main(String[] args) {
        createApplication();
    }

    private static Lwjgl3Application createApplication() {
        return new Lwjgl3Application(new YourGame(), getDefaultConfiguration());
    }

    private static Lwjgl3ApplicationConfiguration getDefaultConfiguration() {
        Lwjgl3ApplicationConfiguration configuration = new Lwjgl3ApplicationConfiguration();
        configuration.setWindowedMode(1234, 123); // <- where you can set the default window size here
        return configuration;
    }
}
raw warren
#

i talking about libgdx, man...

distant perch
#

I know, that's the class that launches a libgdx game

#
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
raw warren
#

BRAINCRACK

distant perch
#

how does "DesktopLauncher" look like

raw warren
#
package com.mygdx.game.desktop;

import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.mygdx.game.Drop;

public class DesktopLauncher {
    public static void main (String[] arg) {
        LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
        new LwjglApplication(new Drop(), config);
    }
}
distant perch
#

well there you go

raw warren
#

oh im stupid

distant perch
#

add
config.setWindowedMode(something something)

raw warren
#

ok i understand

#

facepalm

distant perch
#

😉

raw warren
#

@distant perch the configuration has only 2 setters

distant perch
#

try

config.height = 480;
config.width = 640;
raw warren
#

frameworks are too complex for my brain

#

@distant perch this works

#

thanx man you have quantum brain

distant perch
#

if you want to change the window size while the game is running you can also call

Gdx.graphics.setWindowedMode(width, height);

but since you mentioned you wanted to code for android as well I would check before calling that if it's not on android (changing the window size on android doesn't make much sense)

if (!Gdx.app.getType().equals(ApplicationType.Android)) {
    Gdx.grpahics.setWindowedMode(width, height);
}
raw warren
#

also works

#

where do you learn about all these methods?

distant perch
#

just playing around with it and if I'm stuck, asking people on discord

raw warren
#

@distant perch okay, thanks)

restive tapirBOT
#

DannyWarp gave karma to this_is_phil

lone radish
#

I need help

if you look closely(might be too bad resolution) the planet vibrates when I move. You can se the stars flickering in the lower left. I don't understand why i vibrates. I can provide the code for the movement

quiet ibex
#

@lone radish that's because of improper handling of subpixel positioning

lone radish
#

What now?

#

I am rewriting the whole thing tho

#

I am making it a render target instead

quiet ibex
#

you probably had a blurry render and then set the samplerstate to pointclamp

lone radish
#

I was printing it directly to device

quiet ibex
#

a pointclamp samplerstate is not good enough to deal with this on its own

lone radish
#

But I have another problem now

#

Wait

#

Tell me about the subpixel thing @quiet ibex

quiet ibex
#

@lone radish basically the pointclamp filter can make pixels disappear if you try to draw them between screen pixels

#

its also why it looks like the thing vibrates

lone radish
#

I don't use a samplerState at all

#

The planets don't vibrate anymore but the stars do dissapear from time to time

dense sable
#

I think I have the same problem

#

I don't know if it's visible enough but when the camera moves in a horizontal or vertical momement it's ok but not with diagonal movement

quiet ibex
#

@dense sable there's no one size fits all solution for this sadly, one option is to render different things on different "pixel grids"

#

i've done that in a game where the camera is fixed to the player and the rest of the world is rendered to a render target that's then aligned to make the camera movement completely smooth

#

the player sprite can be positioned between 2 background pixels in that case though. so it's not a pixel-perfect render

dense sable
#

I'll consider using two different render targets, but I don't really see what to do to have a smooth camera movement

#

i feel like now it's just doing ←↓←↓ pixel by pixel

hot hazel
#

I think the idea is that you can move the render target at partial pixels, but it may look blurry so only use it for the backgrounds

orchid perch
#

I recognize that name...

#

Anyway, one simple solution to this week-old discussion is just to always render everything at exact pixels. Just... round them off.

#

Intuitively it would make things jitter but in practice it looks good.

quiet ibex
#

@orchid perch no that's what he has and it does noticeably jitter

#

it's just such a common problem, that people go "omg, i didn't know things could look this smooth" when you get it right

orchid perch
#

Yeah.

#

Jittering means you're either jumping back and forth, or in pixel steps of alternating lengths.

#

If everything is floating point and you only floor it for the final render it usually works out.

#

My suggestion is always if you're making a pixel-perfect game to work in pixels. I actually am using integer position values at all times and I think I got the motion right. Could do a write up on it.

timber mesa
#

after joining a game jam and realizing with horror that I had no idea how to architect a game I looked into some ways to structure a game; libgdx comes with an entity-component system plugin that I'm currently playing around with but I have a question: components are supposed to contain "data" and not "functionality".

But how strict is that? in Kotlin, which I'm using for my playing-around, functions can be treated like data. It's cute, but is it "actually" data? What happens if I put a field for a function from say, integers to integers into a component's constructor (not as a method, just as raw data)? What goes wrong? Does this kind of thing have undesired side effects? And if there is a channel to ask questions in better than this one, which one is it? Thanks!

raw warren
# timber mesa after joining a game jam and realizing with horror that I had no idea how to arc...

In general, most ECS's don't literally enforce the data-only components, but it's in the purpose of the ECS design itself that components be only data so they have as little overhead as possible.

In concept, data is simply values that are stored. floats, ints, bytes, data that's read/written to.

I'm not sure what you mean by functions getting treated like data, unless you're talking about delegates/function pointers. In which case, yes, in theory, a delegate/fp is just like any other data, and will be modified/reinterpreted in undefined ways if you treat it like other data types. However, there's nothing inherently wrong with passing those around.

quiet ibex
#

@timber mesa when you bundle logic and data, you end up eliminating the reusability benefits of the ECS

raw warren
upbeat eagle
hot hazel
#

can you translate that to english?

upbeat eagle
#

The imported project [path] was not found. We have also tried to find [Path] in the rescue path for [path]. Theses search paths are defined in [Path]. Check if the indicated path in the <import> declaration is correct and if the file exists on the hard drive in one of theses search paths. [Path]

@hot hazel

hot hazel
#

Try reinstalling monogame, or use the nuget pkg

fossil mesa
#

I highly recommend libgdx. I'm writing this game with it now.

inland vessel
#

Love the visual aesthetic of your game @fossil mesa The tower looks dope

tight venture
#

LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); that is loooooooooooong

supple depot
#

that tower looks nice

true wind
fossil mesa
raw warren
#

im newbie to monogames

marsh palm
#

Does anyone know a good tutorial for Tower defence games in monogame?

digital dragon
#

I don't think there is a tutorial specific to tower defence, but if you look for XNA tutorials you will find a lot. Most of the stuff described for XNA still applies to monogame

#

the monogame documentation lists various sources for tutorials as well

marsh palm
#

Thanks

quiet ibex
#

@marsh palm it's tough to find tutorials for specific games and tech combinations. but you should have no trouble finding info about how tower defence games are constructed and then you can more easily look up how to do the specific things in monogame

glacial hull
#

Hi guys, sorry, maybe my question is not for this channel, but I can't find where I can ask )) So I am Manual QA Tester and now testing games based on libgdx and want to start automate my tests and don't know which tools I can use for it, I saw many tools for mobile automated tests but idk is there match for gaming, if you can give me advice or provide to the right channels it will be very helpful for me )))

azure geode
quiet ibex
#

@glacial hull if you want the test to be more than a glorified keyboard macro, you're gonna have to talk to the devs and establish an architecture that allows for testing

#

and it's usually not viable to replicate an entire testing session with some scripts

glacial hull
flat orchid
#

has anyone worked with fmod in monogame? if so, any tips/guide/info on setting it up and getting it to work?

hot hazel
#

any reason you want to use fmod in particular?

flat orchid
#

does wwise work easier?

#

if wwise has a specific solution for monogame then sure

hot hazel
#

is what monogame provides not sufficient?

flat orchid
#

for audio?

#

no

#

most engines have really lackluster audio solutions

#

and even if it did have a good one, i'd still be using fmod

hot hazel
#

well i imagine fmod is like using it anywhere else

#

im pretty sure someone has written a .net interop lib

flat orchid
#

yea let me find that

#

i found a solution on git

#

apparently there's a small bit of fucking around with this

#

but it should work(?)

frigid fiber
#

I'm using FMOD with MonoGame and I used the aforementioned github link. However the latency is awful :(

#

Oh. wait. I'm actually not using that link. I started using that, but I switched to the FMOD c# bindings when I wanted to decrease the dependencies of my project. The FMOD installable api includes the C# bindings.

flat orchid
#

why this though

#

like

#

this is from the tut, i'm telling it to search in content yet the command goes through nectoreapp31

#

oh i just needed to build lol

#

N I C E

#

it works

#

@frigid fiber how do i link an fspro project to monogame now?

#

i'm guessing you've managed it

frigid fiber
#

@flat orchid You have to build the .fspro (F7, I think) from FMOD Studio. Then it generates 1 or more .bank files.
Then you use FMOD.Studio.System.loadBankFile () to load those .bank files

flat orchid
#

thanks a lot @frigid fiber

restive tapirBOT
#

Subdivisions X-1 gave karma to Kak

raw warren
#

Is there an easy way of getting MonoGame to work with MonoDevelop?

hot hazel
#

In what way?

flat orchid
#

sounds like it makes sense

#

or nuget package(?)

#

if monodev has those, idk haven't used it

hot hazel
#

can also clone it off github/download release

#

you just need to link in the assemblies

raw warren
#

that's why I was having issues

hot hazel
#

i use VS, but don't use the integrations, I just link it from nuget

raw warren
#

yeah it works fine with VS on my old laptop

#

but my new laptop is running ubuntu

#

so I just didn't know if anyone had an easy fix for it

#

that's all

hot hazel
#

does nuget not work?

raw warren
#

I'll give that a shot

#

I'm not sure how that will interact with the MonoDevelop that's already there

hot hazel
#

I think it prefers the nuget versions but either should work hopefully

quiet ibex
#

@raw warren guessing you're using the Linux version of MonoDevelop? it's about a decade past it's expiration date, unless someone picked it up after xamarin

hot hazel
#

vs code might be sufficient

raw warren
#

ok

#

thanks all for the help

formal basin
#

i started using monogame today and it's gotten me to learn a lot about how it works further down to the metal

#

very refreshing

twin cove
#

@formal basin And is Monogame more beginner friendly then unity in general?

formal basin
#

not really, but if you want to get into it from unity you'll recognize a lot of things from unity's basic scripting functionality

cunning vault
#

How do I add Monogame build targets to Visual Studio?

hot hazel
#

do you want the content pipeline or just monogame?

upbeat pendant
#

Hi, I have a question about libGDX. To make a long story short, a few months ago I found Unity very limiting and I switched to libGDX and it's really great. I love the code freedom and cleanliness. I want to continue to develop in libGDX, but there is one thing that concerns me the most... Is it possible to make a good looking 3D game using libgdx?

#

what you think?

hot hazel
#

assuming it lets you create your own shaders and supports e.g. multiple textures, then yes of course

#

it will be a lot more work to make it look good over what unity provides out of the box however

upbeat pendant
#

technically it allows us to create shaders. There is even some shader lib. But this still looks poor compared to the default Unity scene... So I wonder if there is any good looking game made with libGDX which I could refer to as a proof of concept?

#

For me Space Haven is so far best looking game made with libGDX, but is 2D and completely different art style

plain quartz
#

How to build game in visual studio using monogame ?

rocky shard
#

Hey fellow MonoGame developers, I have a real puzzler for you. The first (and rarely, also the second) time that I start my game every hour or so, nearly all of my textures are black. I'm loading my textures from a packed spritesheet created with TexturePacker, and from what I've noticed, the only images that load successfully are from one specific folder: images/entity/monster. Here are some images so you can see what I mean. This is a very difficult issue to debug because after it happens once, it takes around another hour before it will randomly happen again.

#

I'm really stumped on this, so any tips at all would really be appreciated. This happens no matter how/where I run it, as far as I can tell

quiet ibex
#

you just have to comb through your code for bugs, make sure everything is meticulously planned out and work exactly as intended

hardy jolt
orchid frigate
#

Hey everyone,

I do write a game and do use a entity component system model for this

I do have the following parts for the core of the structure

EntityManager
ComponentManager
EventManager

And a wrapper to get a central access point for everything.

Now I was thinking how I could use UI to show data to the player because the gui is not connected to the ECS right now and everything I read told me better don't enforce the gui system into the ecs. My idea was to register the gui elements into the EventPipeline and push status changes throug the pipeline to the display.

What do you think about this approach?
I would create a "GUISystem" which catches those events updating the gui data. But since the gui is not using the rendering system from the ecs it kind of breaks the idea of a central system which manages everything.

hot hazel
#

What is the purpose of component manager?

hot hazel
#

@orchid frigate you seem to have a lot of indirection

#

also a lot of your doc comments leave more questions than answers

orchid frigate
# hot hazel What is the purpose of component manager?

I do use it to manage the components for the ecs

It also does pool the old already used components so I can reuse them to prevent the gc.

That the docs are missleading and not really helpful is bad,sorry I do need to improve it.

Do you need more information?

orchid frigate
hot hazel
#

Components are typically structs, if you're storing in an array that shouldn't be an issue

orchid frigate
#

I do store them in a list one for each type to increase the performance 👍

#

But still my question to seperate the GUI completely from the ecs is this a good one?

Not sure how to integrate it into the ecs otherwise

hot hazel
#

while some composability is nice in a GUI, it doesn't really make sense to have it as a proper ecs imo

#

its very hierarchical

#

if you want an ecs for your gui id say it makes more sense to have your gui itself be its own ecs, and then if you need your entities in game have components that refer to entities of the GUI

#

as they don't have any overlap otherwise (your UI entities should data bind with the game but that should be the extent of the relationship)

orchid frigate
#

Thank you very much I will try to implement this 👍

orchid perch
#

Me over here using his ECS for his GUI like: 👀

hot hazel
#

doable, but not sure its worth the complexity

sage quest
#

How difficult would you say learning monogame is compared to other frameworks like pygame, and if it is more difficult what features or unique attributes does it have that sets it apart form others like pygame. Lastly, I noticed that monogame has sort of a structure to it ( a separate function to load, draw, update, etc.) how does this impact development with it compared do other frameworks that don't have this, for better or for worse.

hot hazel
#

monogame just provides you with the basic abstractions so you don't have to worry about things like creating a window, interacting with graphics api (dx/opengl), etc

#

and provide some helpful helpers (math library code, model/textures/etc)

#

beyond that, it's all up to you

#

its not an engine

#

the load/draw/update/etc that it provides are optional

quiet ibex
#

@sage quest it impacts your development a lot or not at all, depends on how you use it. But it sounds like you don't know C# so if you read up on that, you'll start to figure out what really sets it apart from things like pygame

honest fjord
vale zephyr
#

soo, do i really need to use SpriteBatch for something like drawing solid color rectangles on the window/game

digital dragon
#

what else would you want to use?

#

or more to the point: why not use spritebatch?

vale zephyr
#

just based on what i saw in monogames documention, spritebatch is used for actual sprites, no?

digital dragon
#

well, it's for pretty much all things 2D

vale zephyr
#

oh

digital dragon
#

spritebatch abstracts the whole concept of drawing 2D graphics within a 3D renderer so you don't have to take care of texture positioning beyond a 2D plane

#

it is put together as a batch of graphics in order to have it only create one object to draw for the graphics card instead of creating a draw call for every single sprite

#

so you draw your 2D sprites / textures / text into a spritebatch (or multiple if necessary, iirc there is a call limit), the spritebatch then combines it for you into just one image and sends it to the graphics card

vale zephyr
#

yeah i got it

hot hazel
#

the alternative is to build quads (two triangles) and render those yourself

#

but thats basically what spritebatch is doing for you

mighty herald
#

Type parameter 'T' cannot be instantiated directly

#

anyone know what am i doing wrong?

hot hazel
#

: new()

#

After the class decl before {

mighty herald
#

?

hot hazel
#

Sorry, where T : new()

#

Google generic constraints c#

mighty herald
#

this is java D:

#

i had to do it for school D:

amber pawn
#

(sorry i just saw this, and this exchange is freaking funny as hell)

#

afaik there are generic constraints in java

quiet ibex
#

generics would be useless without constraints

mighty herald
#

:0

hot hazel
#

Less useful *

amber pawn
#

so the google keyword i'd use is "java generic array instantiate"
but honestly seeing the results point to reflection is discouraging

mighty herald
#

so rather than doing new T[][] i should pass in an existing array?

amber pawn
#

i think array is maybe not what you want to use in java for generic typed collections

quiet ibex
#

@hot hazel no you can't actually do anything without constraints, but typically you have a few implicit ones built into the language

hot hazel
#

?

pale wind
hot hazel
#

why?

weak salmonBOT
cunning wraith
pale wind
weak salmonBOT
#

W A D gave karma to Pabeio

cunning wraith
pale wind
cunning wraith
pale wind
#

Stay tuned for updates and news!

cunning wraith
#

Ok! Thank you, and good luck with your project!

pale wind
weak salmonBOT
#

W A D gave karma to Pabeio

lilac atlas
#

Thank you

cunning wraith
#

No problem

vocal sun
#

@raw warren

raw warren
#

Yes

#

People here

vocal sun
#

it's a bit of a ghosttown...

raw warren
#

Understandable

raw warren
#

monogame

#

the big ded

stiff slate
#

dead

gaunt sky
#

Hello

amber wave
#

ded

digital dragon
#

I still do monogame stuff, but I never really have to ask about anything.
Monogame is so simple, there aren't really many questions coming up about it

flat turret
#

same. The monogame discord is so active that any questions I have I can get answered there

flat turret
#

<@&133522354419662848>

digital dragon
#

monogame is an open source continuation of the XNA framework.
XNA is a freeware game development framework that microsoft used to publish back in the xbox 360 days.

flat turret
#

@little moat thoughts on monogame for webgl?

drifting sorrel
#

Monogame for webgl is the reflection of a project that is a management disaster.
650+ bugs reported with none fixed during months, incredibly interesting PR with things like compute shaders or geometry shaders which are completely ignored by management, and one of the maintainers decides to incorporate a new platform which nobody asked for and for no real reason other that "look my lame 2d game runs in a browser with major bugs" with a technology already obsolete the moment they shipped it.

raw warren
#

<@&133522354419662848> scammer

#

<3 thankss

weak salmonBOT
hot hazel
#

idk about anyone else but I keep getting notified that this channel has unreads

lone patio
#

is there some sort of component-based game object library for monogame?

lone patio
#

oooh thanks @hot hazel

weak salmonBOT
#

Technostalgic gave karma to CobaltHex

lone patio
#

wasn't really sure exactly what search terms to use

jovial mortar
lone patio
#

If I'm looking for a 2D rigidbody physics engine to use with monogame, what would you guys recommend? I've only really seen Farseer physics recommended for c# online but I've used that in the past and I remember having some issues with it so I'd prefer to use something different. Does anyone have suggestions? I think I'd prefer to use something written natively in C# rather than a port, but I'm still open to using a port as well. Thanks in advance!

hot hazel
#

What is the issue you were having?

frigid fiber
#

AetherPhysics is based on Farseer but has been improved quite a bit in the last years and it's still maintained (last version was released 9 days ago)

hot hazel
#

no, this is spam...

#

<@&133522354419662848>

slate echo
#

The first step is removing all Microsoft.Xna.Framework.XXX references and replacing them with references to MonoGame.Framework and MonoGame.Framework.Content.Pipeline. This is required as you will no longer be building against Microsoft XNA.

#

I'm getting a lot of build errors

flat turret
#

You keep the references to Microsoft.Xna.Framework because that's the namespace Monogame uses to maintain backwards compat with games originally written in XNA

#

(for the record, FNA does the same technique)

#

MonoGame.Framework has a few extra tidbits that Monogame has added to the framework for additional functionality. It does not replace the Xna Framework namespace

#

Whatever guide/person told you to remove Xna Framework references is misled

dusty drum
#

Hi! does anyone have a link to learn about reading data from json or xml in monogame? I'm trying to read in some meta data for a sprite made in Piskel. I loaded the xml in the content pipeline but I cannot find any doc on how I would then use it

hot hazel
#

you can just read xml or json directly in c#

#

system.xml iirc and Newtonsoft.Json (or if you use modern c# system.text.json)

frigid dagger
#

@dusty drum ill show you how i serialize and deserialize object data with xml

first, your object cannot have a texture2d in it, texture2d cannot be serialized (i believe possibly color arrays can be but its usually not something that games do) you load your entire textures into content as usual
so you create a new class that contains the data that you want to save in xml, this class will not perform any actions it is only a base for your objects data, something like this

    public class EnemyData
    {
        public int enemyID;
        public int enemyHealth;
        public Vector2 enemySpawnPosition;
     }```
now at the top of your main class (or whichever class you build your enemies, etc) you need to include xml in your project
```using System.Xml;
   using System.Xml.Serialization;```
#

in your main/world class you build the serializer and the empty object

   EnemyData enemyData;```
initialise this serializer with the EnemyData class we built
```enemyXml = new XmlSerializer(typeof(EnemyData));```
so now you most likely dont have a file to read so we can write an xml file to your desktop, make sure you run this part only when you want to create a fresh file or save over a file
```                TextWriter writer = new StreamWriter(@"C:\Users\PC\Desktop\EnemyDataFile.xml");
                   enemyXml.Serialize(writer, enemyData);
                   writer.Close();```
this xml file will be plain text since we didnt encrypt it so you can now open the file as a notepad file and edit the int, vector2 or whatever other data you make your object have.
and now read the data from the file wherever you have it located into your enemyData that you declared
```TextReader reader = new StreamReader(@"C:\Users\PC\Desktop\EnemyDataFile.xml");
   enemyData = (EnemyData)enemyXml.Deserialize(reader);
   reader.Close();```
so basically if you now create a new class called enemyObject you can make it inherit all of the data that enemyData is holding
```enemy1 = new enemyObject(enemyData.enemyID, enemyData.enemyHealth);
   enemy2 = new enemyObject(enemyData.enemyID, enemyData.enemyHealth);```
but the real strength of serialization is by creating a list of data, so you could store many enemies, objects on the map, level editing data, inventory data, all read from and written to a single file the same way we read any data
#

@dusty drum if you want a bit of help on how to implement it in your specific use case let me know

dusty drum
#

ah great thank you so much @frigid dagger

weak salmonBOT
#

talis thanked Melt

dusty drum
#

I do have a question regarding the content manager, you reference the xml by full path-- what if this was an android game? I'm new to monogame, but assumed that was the purpose of the content.mgcb file. I see it is able to build with the xml file, but I'm not sure how I would reference that in a stream reader

#

the use case is the sprite editor I am using, it can export meta data as a text file. like how many frames, dimensions for each frame etc. this way I can display the sprite from a sprite sheet the editor created

#

maybe there is a better way to do this though

flat turret
#

Many people ditch the content mgcb in favor of their own content loading system (as mgcb is... Pretty bad). You can add resources to your game via a data path and then reference them via relative paths

frigid dagger
#

@dusty drum so for reading the image data im not too sure what you load the json metadata into.

when i read my image data i make an image in piskelapp and export it as a spritesheet
and i read the image into my own data object which has image XY positions and number of frames and framesizes etc

#

so i read this notepad information and it spits out the positions of my content

#

and i can modify it at will on the image or in the data

dusty drum
#

are you manually creating that xml?

frigid dagger
#

i looked at the json metadata and it stores a lot of different fields in it
{"frames":{"New Piskel0.png":{"frame":{"x":0,"y":0,"w":64,"h":64},"rotated":false,"trimmed":false,"spriteSourceSize":{"x":0,"y":0,"w":64,"h":64},"sourceSize":{"w":64,"h":64}}},"meta":{"app":"https://github.com/piskelapp/piskel/","version":"1.0","image":"New Piskel.png","format":"RGBA8888","size":{"w":64,"h":64}}}
i suppose you would need to make an object that can store that data and then read it straight into your project

#

yea i just write the numbers into each field in the xml based on the image i create in piskel

#

its definitely not as streamlined as exporting the data from piskel and importing it back. but this way i get to just play with the data i want

dusty drum
#

ah okay, makes sense

frigid dagger
#

yea so i would suggest just finding what object you need to build in your project that can deserialize the data into

#

but its very worthwhile just making a simple object that stores coordinates and sizes of your images

dusty drum
#

Yea I like that approach, simple and effective

#

thanks again!

frigid dagger
#

and then for things like my map builder i launch a map builder project and import all my images then when i place one of them in the blank map i save its location to xml

#

and read that xml in the live game

#

so for placing maps you dont even need to open the raw data or change it manually

dusty drum
#

ah that's a good idea, yea ill have to build a little editor at some point

frigid dagger
#

yea good luck with your next mission, i was probably a bit vague about some things so i can clarify on something if you need but hopefully youre closer to a solution you want 🙂

velvet stratus
#

How can I prevent monogame from rebuilding my assets each time I run the game ? Like he builds my font every time I run the game and it takes time ...

flat turret
#

with mgcb? Those should be precompiled once in the mgcb editor (or just toss that out and spin up your own asset loader)

grizzled forge
#

hi

#

stop trying to shag my dad he doesnt want you

#

ye

#

he is a good man

#

he doesnmt want you

hot hazel
#

@grizzled forge are you ok?

lone patio
#

Is there a way to make the monogame content builder use local paths instead of full paths? Every time I switch computers I need to commit that change to version control because the path changes

hot hazel
#

Edit the project files and see, I don't use mgcb but everything was always project relative for xna

honest fjord
#

the best news: it's already over... and you get to play everyones games!

#

specifically, my partner and i created a 2d puzzle platformer. it's playable in the web browser... and it's really hard.

lettuce, or any of the libgdx-ers what you think about the submissions!

https://javacakegames.itch.io/zero-gravity

silk oracle
silk oracle
silk oracle
#

This is a pixmap utility that can be used to create a clone of a pixmap with a different alpha, to create an outline of a pixmap, to create a shadow, and create a light

crimson yacht
#

hi

#

how can i parse specific textures from a texture?

#

i got the thing that controls textures working

#

i just cant do the algorithm

#

this is an example sketch i drew to illustrate what i will do in one dimension

#

same for the y

#
                    if(x == spritesX - 1)
                    {

                        var textureToAdd = TextureRegion(sheet,
                            ((spritesX+spaceBetweenX)*spritesX)-spaceBetweenX,
                            ((spritesY+spaceBetweenY)*spritesY)-spaceBetweenY,
                            width,height)
                        SheetAssets[nameToConvert]!![keyToAdd] = textureToAdd
                    }
                    else
                    {

                        var textureToAdd = TextureRegion(sheet,
                            ((spritesX+spaceBetweenX)*spritesX),
                            ((spritesY+spaceBetweenY)*spritesY),
                            width,height)
                        SheetAssets[nameToConvert]!![keyToAdd] = textureToAdd
                    }```
#

this is the code i wrote for this

#

ignoring the fact that this assumes that the textureregion uses bottom left point

#

this only shows this single texture in this spritesheet

#

soo, what do i need to write as algorithm for this?

#
    fun loadSheetAtlas(directoryToSheet: String, names: List<String?>?, width: Int, height: Int, spaceBetweenX: Int, spaceBetweenY: Int, spritesX: Int, spritesY: Int)
    {
        SheetAssets = mutableMapOf<String, MutableMap<String,TextureRegion>?>()
        var nameToConvert = Gdx.files.local(directoryToSheet).nameWithoutExtension()
        nameToConvert = nameToConvert.replace(' ', '-').toLowerCase()
        var sheet = Texture(directoryToSheet)
        var nameIndex = 0
        if(!SheetAssets.keys.contains(nameToConvert)) // to see if we have parsed it already
        {
            SheetAssets[nameToConvert] = mutableMapOf<String, TextureRegion>()
            for(x in 0 until spritesX)
            {
                for(y in 0 until spritesY) // when i put a -1 to spritesX/Y the keycount becomes 121 for 12,12?
                {   // I check for if names is null every single loop, can be optimised to check for once but that'd be premature optimisation
                    var keyToAdd = if((names != null) && (names[nameIndex] != null) ) names[nameIndex]!! else nameIndex.toString()
                    if(x == spritesX - 1)
                    {
                        var textureToAdd = TextureRegion(sheet,
                            ((spritesX+spaceBetweenX))-spaceBetweenX,
                            ((spritesY+spaceBetweenY))-spaceBetweenY,
                            width,height)
                        SheetAssets[nameToConvert]!![keyToAdd] = textureToAdd
                    }
                    else // these will work if textures use bottom left origin point
                    {
                        var textureToAdd = TextureRegion(sheet,
                            ((spritesX+spaceBetweenX)*spritesX),
                            ((spritesY+spaceBetweenY)*spritesY),

#
                            width,height)
                        SheetAssets[nameToConvert]!![keyToAdd] = textureToAdd
                    }
                    nameIndex++
                }
            }
        }

    }```
#

ignore the comments

#

this is the code i currently have

#
lateinit var SheetAssets: MutableMap<String, MutableMap<String, TextureRegion>?>
#

outside the Assets object

#

this function is within the assets object btw

#

so to summary

#

how do i parse standalone textures from a spritesheet

crimson yacht
#

like the algortihm of it

crimson yacht
#

help

silk oracle
#

Are you just trying to split the sprite sheet so you can extract specific images?

#

TextureRegion has a static method called split(tileWidth, tileHeight)

TextureRegion.split(int tileWidth, int tileHeight)
#

it's a 2D array

#

@crimson yacht

crimson yacht
silk oracle
#

so, you're wanting to assign each texture a specific location you can pull from?

#

because some have different padding between?

crimson yacht
silk oracle
#

So, you have a sprite sheet with images that all have different lengths between them, right?

crimson yacht
#

something like this

silk oracle
#

Looks like all of those GUI elements have more than a padding of 0

#

are you using LibGDX?

crimson yacht
#

yes

crimson yacht
#

but still, a good candidate for applying padding

silk oracle
#
GUIPack.png
size: 647, 558
format: RGBA8888
filter: Nearest, Nearest
repeat: none
Empty Button
  rotate: false
  xy: 0, 0
  size: 8, 8
  orig: 8, 8
  offset: 0, 0
  index: -1
Play Button
  rotate: false
  xy: 8, 8
  size: 8, 8
  orig: 8, 8
  offset: 0, 0
  index: -1

^ That's what an atlas pack looks like, so you can assign each image a location and name

#

The xy: is the location, the size is obviously the size in pixels

crimson yacht
#

i know how atlases work

#

but

#

i thought i couldnt implement atlases for this

#

as it is an atlas itself

#

arent atlases for combining hundreds of textures into one big one?

silk oracle
#

It can be, yes

#

Or, you can take one texture and split it into multiple using the atlas file and loading it as such

#

In case all of your images are already on one image

crimson yacht
#

the file im using as a spritesheet is literally just a png file

silk oracle
#

I understand

#

Just treat it as if it's a packed texture

#

A Texture pack is literally just an image packed with other images, therefore being ONE image

#

I promise it's that simple

crimson yacht
#

im trying to get standalone textures and store them in a way i can retrieve as such:

#

SheetAssets[SpriteSheetName]!!["MenuButton"] : TextureRegion

hot hazel
#

Sprite { File; Region }
Object { Sprite foo; blah ; }

silk oracle
#

Exactly what a TextureAtlas does.

Try doing this:

Create a TestPack.atlas file with the PNG file in the same folder. Add the png file name to the top of the atlas and a test for the menu button to it like so:

Test.png
size: 647, 558
format: RGBA8888
filter: Nearest, Nearest
repeat: none
Menu Button
  rotate: false
  xy: 0, 0
  size: 8, 8
  orig: 8, 8
  offset: 0, 0
  index: -1

Load the texture atlas, find the region called "Menu Button", and see how that works?

#

You now have a texture in your sprite sheet called menu button when you load it up from the PNG file

crimson yacht
#

i guess thats what i tried doing from the beginning

#

so it supports parsing classical spritesheets

#

great

silk oracle
#

If you look at the code I provided, you'll see under the repeat row, that there is a Menu Button text. That's the name of the region, and every time you create a new region, you need to add the tabbed spacing underneath it to provide the rotate, size, offset, etc.

#

The xy: 0, 0 variable is the location to cut from the image and the size:, 8, 8 is the size in pixels of the image to cut

#

I assume you're writing this in Kotlin?

crimson yacht
#

ohh

#

i need to do it manually?

#

damn

#

that was the reason why i tried to build a spritesheet parser

silk oracle
#

textureAtlas.addRegion("name_here"); works

#

atlas.addRegion(name, texture, x, y, width, height)

#

If you don't want to use a file

crimson yacht
#

ooh

#

this is absolutely what im trying to do, thanks

#

wait

#

how do i get the texture from it?

#

i already try to get texture with the parser

silk oracle
#

TextureRegion(Texture texture, int x, int y, int width, int height)

#

set the x, y, width, and height of the texture you're taking from

crimson yacht
#

aand we have looped back to the beginning

silk oracle
#

Texture menuButton = new Texture("TestImage.PNG", 0, 0, 8, 8)

textureAtlas.addRegion("Menu Button", menuButton, 0, 0, 8, 8);

crimson yacht
#

that atlas method is just a method to retrieve the single textures

#

the problem is automatically assigning it

#

i think i made an off brand texture atlas already

crimson yacht
silk oracle
#

How do you mean automatically? Don't you have to assign them a specific name any way? Like "Play Button", "Menu Button", "Exit Button", etc?

crimson yacht
#

if i set it to null it is set to index number

#

sec ill send an illustration

silk oracle
#

Dang man. I would really just suggest the atlas regions because it's cleaner and you don't have to write all that code for it

crimson yacht
#

there are 144 textures :/

silk oracle
#

<.<

crimson yacht
#

so anyone can help?

crimson yacht
hot hazel
#

write a file format that encapsulates the info you want

#

also id say you're doing it backwards

#

rather than creating 'regions' in an atlast

#

everthing you want has a 'sprite' that defines the region of what image

crimson yacht
#

as a mutablemap<string, mutablemap<string, textureregion>>

crimson yacht
#

@hot hazel ?

hot hazel
#

Yeah wrong direction

crimson yacht
#

wrong in what direction

#

can u elaborate?

hot hazel
#

I already explained

#

Don't make a dictionary of names to regions

crimson yacht
#

ok that is the easy part to fix

#

but the main problem is that i need to find an algorithm

hot hazel
#

For?

crimson yacht
#

get specific textures from a png with each texture having width, height, posx, posy variables

#

with offset in between textures

#
    fun loadSheetAtlas(directoryToSheet: String, names: List<String?>?, width: Int, height: Int, spaceBetweenX: Int, spaceBetweenY: Int, spritesX: Int, spritesY: Int)
    ```
#

an example sketch

hot hazel
#

Use a grid or a bin packing Algo

#

Then store the regions in a file

crimson yacht
hot hazel
#

Store the regions in a file

crimson yacht
#

how do i generate the "regions"

#

that is the main problem

#

parse, i meant

hot hazel
#

Json,csv

#

Standard file parsing

#

Look at Sprite font generators and their output

crimson yacht
#

that might be what im looking for

#

does it support distance between textures?

#

wait

#

arent sprite font's a bit too "official" and unsuited for game use?

hot hazel
final kestrel
#

Bit of an odd request, I'm in need of a sprite font .xnb containing as many unicode characters as possible. I'm building "Arial Unicode MS" right now but its taking a while via the MGCB, wondered if anyone had one already built they could share to save me the few days time it'll take to build 65k glyphs

hot hazel
final kestrel
# hot hazel I would build them into multiple sheets probably, or you may just want to find a...

I have a ttf, It's a little weird of a situation where Im modding an existing MonoGame application and need to load my own SpriteFont to support as much potential user input as possible, without knowing the language theyre gonna use beforehand. I'm currently building the ttf->sprite font->xnb, how would you suggest going about multiple sheets? It's been a while since I've touched MonoGame proper

hot hazel
#

diy

#

dont use the monogame spritefont system

#

but honestly id find a TTF renderer

final kestrel
#

Right, not a bad shout, I'm using some of the helper functions for displaying text in the original game I'm modding atm so would require writing my own systems for that - which is doable for sure, the code isn't complex. I may go down that route instead - thanks!

hot hazel
#

but either way i guess

#

use code pages

#

they're like 4096 characters a page i think

#

and one sprite font per code page

#

then swap em out

final kestrel
#

Code pages? I'm afraid Im not too familiar with font formats and the like prior to this

hot hazel
#

its a legacy windows thing

#

you'd just be emulating/recreating it yourself in code

#

the spritefont system has support for sparse fonts, but its going to put every character in one sheet I think, which i dont think is what you want

crimson yacht
#

i think i asked the wrong question at the first place

#

is there a spritesheet parser library or app

hot hazel
#

im sure someone who built a packer has written one

#

it will probably just be as quick to write your own

raw warren
#

I'm trying libgdx in visual studio code but for some reason it can only compile to desktop. All the other builds say: Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Also, I get some problems:

#

Could somebody please help me with this?

silk oracle
#

Looking for anyone who wants to develop a game in LibGDX

#

XD

crimson yacht
#

im trying to make a 2d top-down strategy game with procedurally generated maps but i have no idea how i would implement the tilesystem, which would contain
map
.........chunk
.......................tile

#

how can i implement it?

#

the procedurally generated part is the main problem

#

now i absolutely need to have a list containing activeChunks for like chunks in render distance in minecraft

#

but i have no base for it

#

no base code or any tutorial

#

any help would be appreaciated

hot hazel
#

procedural generation is a whole topic

crimson yacht
#
        fun generateMap(seed: Long = 1, Info: Map)
        {
            var noise = OpenSimplexNoise(seed)
            Info.chunks = Array(Info.xChunkLimit) {i -> Array<Chunk>(Info.yChunkLimit) {i -> Chunk()} }
            for(x in 0 until Info.xChunkLimit)
                for(y in 0 until Info.yChunkLimit)
                {
                    Info.chunks[x][y] = generateChunk(noise, Info,x* xChunkSize, y* yChunkSize).apply { addTileActorsTo(Info) }
                    //will absolutely cause problems about origin point, row/column misplacement and most importantly negatives
                    //maybe I should find a way to make TopLeft 0,0 the only point and no one can go beyond it
                    //but what about the infinite generation?
                }
        }
        fun generateChunk(noise: OpenSimplexNoise, map: Map, ChunkXPos:Int, ChunkYPos:Int) : Chunk
        {
            var TileList = Array<Array<Tile?>>(xChunkSize) {i-> Array<Tile?>(yChunkSize) {i->null} }
            var index = 0
            for(x in 0 until xChunkSize )     // those two lines
                for(y in 0 until yChunkSize ) // cause problems...
                {
                    var value = noise.eval(x+ChunkXPos.toDouble(), y+ChunkYPos.toDouble())
                    if(value >= 2)
                    {
                        TileList[x][y] = Tile("Plains", value.toFloat(), "Hills")
                    }
                    else if(value <= 1 )
                    {
                        TileList[x][y] = Tile("Sea", value.toFloat(), "Coast")
                    }
                    else
                    {
                        TileList[x][y] = Tile("Plains", value.toFloat(), "")
                    }
                }
            return Chunk(TileList).apply { addTileActorsTo(map) }
        }
#
fun render()
    {

        Gdx.gl.glClearColor(1f, 1f, 1f, 1f)
        //Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT)
        mainBatch.begin()
        var xx = 0f
        var yy = 0f
        for((index, tile) in tiles.withIndex())
        {
            if(tile?.texture!=null)
            {
                xx = nToXY(index, xChunkSize, yChunkSize).x
                yy = nToXY(index, xChunkSize, yChunkSize).y
                mainBatch.draw(tile.texture, floor(nToXY(index, xChunkSize, yChunkSize).x), floor(nToXY(index, xChunkSize, yChunkSize).y))
            }
        }
        mainBatch.end()


    }```
#

could someone please help?

#

tiles is null for some reason

crimson yacht
#

`nvm

lone radish
#

Anyone know anything about shaders? I don' think I've implemented mine the right way

hot hazel
#

or

#

!dontask

weak salmonBOT
raw warren
#

System.InvalidOperationException: This resource could not be created.

at Microsoft.Xna.Framework.Audio.AudioEngine..ctor(String settingsFile, TimeSpan lookAheadTime, String rendererId)

at Terraria.Audio.LegacyAudioSystem..ctor()

at Terraria.Main.LoadContent()

at Microsoft.Xna.Framework.Game.Initialize()

at Terraria.Main.Initialize()

at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)

at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)

#

traceback

#

help

hot hazel
#

<@&133522354419662848>

#
  • sorry
raw warren
#

to come here

#

to someone who knows about the framework

#

the community

hot hazel
#

this is a question only the devs of terraria can answer

raw warren
#

devs are not open to questions

#

and the forums has been dead for a while

hot hazel
#

my guess is that maybe it cant load a file

raw warren
#

it has to do with the audio, it works fine with no devices but when i plug one in

#

it crashes

hot hazel
#

yeah i am not really going to be able to help you much without debugging the program

crimson yacht
#

question

#

say i have a function called fromPixelScalingToGameScaling

#

where i do a few multiplication and division calculations inside it

#

say that i'm calling it 1000 times every frame

#

would it slow down the program by a considerable amount?

#

or say like i have this function

#
fun returnSameObject(number: Int) : Int {return number}
#

how slower is it than directly passing the object?

flat turret
#

what language is this? afaik monogame uses C# and libgdx uses Java, this looks like neither

hot hazel
#

also, profile it

silk jay
#

Hey guys can someone advise why methods of derived class can't be called like that? (C#)
(Derived)BaseClassObject.SomeMethodOfDerivedClass();

#

But at the same time this works
Derived derived = (Derived)BaseClassObject; derived.SomeMethodOfDerivedClass();

flat turret
#

You've just got your parens wrong

#

((Derived)BaseClassObject).DerivedClassMethod();

#

@silk jay

silk jay
#

Ohh, damn, @flat turret , thanks you so much! I used to c++ where (Derived)BaseClassObject.SomeMethodOfDerivedClass(); is correct, and it confused me)) Thanks much once again!

weak salmonBOT
#

Russian spy thanked Triple Seven

fathom scarab
#

is this channel good for FNA too?

hot hazel
#

yes

crimson yacht
#

sorry for late answer

#

oh wrong person

flat turret
#

interesting, I didn't know libgdx worked with all JVM languages

#

I guess that makes sense

lost terrace
#

@daring widget

hot hazel
#

👍 ok

tepid rock
#

spent the last few days looking for a C# ECS library and they all either had bad/nonexistent documentation or were Unity-only, so I wrote my own lol

hot hazel
#

👍

tepid rock
#

this is a really stupid question but does FNA dev fit here as well

hot hazel
#

yes

tepid rock
#

anyone know of a glsl shader support library for FNA?

#

or does it support it natively?

hot hazel
#

why not use hlsl?

tepid rock
#

Figured out what I'm gonna do, I'm gonna create my shaders in glsl, use glslangValidator to convert them to SPIRV, and then use SPIRV-cross to convert the .spv to hlsl

flint temple
#

so im trying to replace music in a game, and i was able to create a new xwb file with new tracks to replace the current xwb, and the game loaded up fine, but the new music in the xwb wont play
anyone know what might be the issue?

hot hazel
#

make sure you actually created it correctly

raw warren
#

Anyone wanna be active in my server? That will be appreciated. Thanks!

hot hazel
turbid grove
#

Managed to set up a Monogame+Nez project on VS code, the next few weeks are going to be interesting! 😄

toxic wigeon
turbid grove
#

Regarding Monogame, should I be drawing everything from the main class? I managed to represent a chunk of perlin noise in colors, but when I began to detach the project into separate files, I found myself lost on how to handle drawing in general.

flat turret
#

What you can do is you can add a "Draw" method to your other classes and provide them with the spritebatch, which they can draw themselves into

#

that way you can do something like

_spriteBatch.Start(); // or whatever the API is,  can't remember
foreach(MyClass obj in sceneObjects)
{
  obj.Draw(_spriteBatch);
}
_spriteBatch.End();  // or equivalent
#

I believe Nez has a thing to handle this for you?

#

You add the Nez object to the scene and it draws itself, or something (I've never actually used Nez, however if you want I can DM you the link to the monogame discord where the nez developer is very active)

raw warren
#

Movement :: Monogame

#

that's what ik lol

turbid grove
quiet ibex
turbid grove
quiet ibex
#

when you're using unity, you typically only utilize a tiny subset of the c# language. so when you do other things, there's a huge gap to fill

pine gate
#

👋

mortal tendon
#

Hey guys, I need some help with tilemap. I find a lot of information on how to load tmx files. but I need to load XML. Could anyone help with it ?

digital dragon
#

Pretty sure tmx is xml based

mortal tendon
digital dragon
#

if you are working in c# you should be able to implement your own parser using the XmlReader from System.XML

#

if you are in java land I am the wrong guy^^

#

also if you don't want to re-invent the wheel, there definitely are a bunch of oss parsers for tmx that you could modify. There might be something in monogame extended as well

mortal tendon
#

Uff, okay. I just thought it would be easier because we can load the tmx with one command and I thought there is something for the xml. I just don't understand why did the game studio give me a map in the format xlm instead tmx

digital dragon
#

you might want to check the actual structure of the file. Maybe it's a tmx file with just an xml file extension?

#

otherwise it might be easier to write a conversion tool that takes their xml and outputs tmx if you already have an importer for that

#

(or maybe they just sent a wrong export by accident?)

mortal tendon
#

I've just looked at tmx format and looked at this, doesn't look like tmx

digital dragon
#

did they supply any documentation for their format?

#

if they just handed you an xml without any description of how it's set up then that's not really useable

quiet ibex
#

i made a library for dealing with it a while back https://github.com/Ragath/TiledLib.Net might need to be updated to handle the latest Tiled features, but it should handle the vast majority of them

sonic basin
#

Wait people still use that engine?

grave fable
#

is there a way to draw a sprite with no texture (just a solid color), and to add the texture later? in monogame

lament gyro
#

I don't think its possible with the standard sprite batch... writing a shader should be the best way.
Tbh I think the question is kind of strange. What are you trying to achieve?

grave fable
#

I don't have textures right now, so I want to use a solid color as a placeholder.
actually, I think I've found a solution.

        private Texture2D SolidColorTexture(int sizeX, int sizeY, Color color)
        {
            Texture2D texture = new Texture2D(GraphicsDevice, sizeX, sizeY);
            Color[] data = new Color[sizeX * sizeY];
            for (int i = 0; i < data.Length; i++) data[i] = color;
            texture.SetData(data);
            return texture;
        }
lament gyro
#

Or you could have just loaded a placeholder texture... But what you asked for was something completely different.

toxic wigeon
silk oracle
toxic wigeon
#

¯_(ツ)_/¯

silk oracle
#

Anyone know how to render a tiled map with a perspective camera (3D)?

hot hazel
silk oracle
grave fable
#

why are my usings broken? there is a red squiggly line under Microsoft.Xna

quiet ibex
grave fable
#

yea, it seems like it doesn't find the packages

#

but I don't know why

quiet ibex
#

probably haven't run nuget restore

grave fable
#

how do I do that?

quiet ibex
#

normally it happens automatically when you build. But if you've turned it off, then right-click the solution and pick restore

grave fable
#

its on. I tried to run it manually, but nothing changed

quiet ibex
#

check the output log for errors then

grave fable
#

All packages are already installed and there is nothing to restore.

quiet ibex
#

then you're missing packages

grave fable
#

My project has the following packages:

MonoGame.Content.Builder.Task
MonoGame.Framework.DesktopGL
MonoGame.Extended.Tiled
quiet ibex
#

and are those the right packages and on the right project?

grave fable
#

I believe so. the first two are the default packages, if I am not mistaken

#

and I am getting errors on ```
Microsoft.Xna.Framework
Microsoft.Xna.Framework.Graphics
Microsoft.Xna.Framework.Input
MonoGame.Extended.Tiled
MonoGame.Extended.Tiled.Renderers

#

basically all the namespaces I try to use.

quiet ibex
#

you've probably got a mismatch between the target framework and the monogame package then

grave fable
#

wdym?

#

whats the "target framework"?

quiet ibex
#

either way, your build output still tells you whats failing

#

probably .net6.0 in your case

#

which does not play nice with monogame yet

grave fable
#

can I use an older framework?

quiet ibex
#

yes

grave fable
#

how do I do that?

quiet ibex
#

edit the project

grave fable
#

the .csproj?

#

(on VS 2019)

quiet ibex
#

yes, but you should switch to vs2022

grave fable
#

Last time I checked the MonoGame VS plugin wasn't avaliable for VS 2022. not sure if its necessary tho.

#

I just looked and my TargetFramework is netcoreapp3.1. not sure if its what its supposed to be.

hot hazel
#

tis not necessary

#

TargetFramework can be set to "net6.0" i think

quiet ibex
#

it can, but it wont work if you do

#

since monogame is broken on .net6

knotty cedar
#

.

hoary basin
#

..

toxic wigeon
#

...

hoary basin
#

....

worldly jetty
#

.....

toxic wigeon
#

I had a couple of hours to kill and made a small game

final herald
toxic wigeon
#

drawing was probably around an hour or two

final herald
#

oh

final herald
#

I am working with LibGDX. I want to set the background of a Label such that it resizes with the size of the Label. For that I am using an image which has a size lesser than the Label. However, due to resizing, the result is like this - (refer to the second attached image). So I made the image larger than the Label. However, it doesn't resize like that - (refer to the first attached image). any solutions?

toxic wigeon
#

Basicall what you need to create is a 9slice. The center piece can then easily be filled with anything else

weak salmonBOT
#

Above & Beyond thanked Rhast0r

rain compass
#

I need webgl shader code to draw image outline.. Any one can help me?

toxic wigeon
#

If i google some of these words i get good hits on google

#

It is better to state the explicit problem you have and what you have tried. People will be mode inclined to help

quiet ibex
quiet ibex
#

tried a google search?

rain compass
#

no res found

quiet ibex
#

i just googled "shader image outline"

rain compass
#

that not work

#

i can show trillion of such things

quiet ibex
#

either you're following the instructions wrong, or you're phrasing the problem wrong. In which case you need to read up on the subject and learn the right terminology

#

if its the former, read up on shaders in general

hot hazel
#

there's a number of ways to do an outline

#

they can get pretty complex

rain compass
#

@hot hazelu know easy one

nimble rose
#

Hello guys i want to step in game development and decided to make 2.5d indie games on java language so what path should i follow

toxic wigeon
#

hard question with no real answer

#

what do you know?

nimble rose
#

Well i am in intermiadiate level of java programming and i want to make games with libgdx so is there any tutorials on how to make games with libgdx

toxic wigeon
#

Seee, this results in a completely different question. No need to feed you beginner stuff.

#

and since there are many parralels you could also check out MonoGame but that one is C#

final herald
radiant sail
#

Hey Everyone,

This week's new free music tracks are:

"SPIFF THE SPACEMAN"

"GRUNGY OLD CODE"

You can freely download them here:

https://soundimage.org/sci-fi-11/

If you can, please consider making a small donation on my website to help support my hard work.

Be well and please stay safe.

upbeat osprey
#

Anyone using Box2D here?

hot hazel
#

!dontask

weak salmonBOT
placid gate
#

Hello, I am trying to create 2D game. I want player to be able to go behind a tree or in front. What is the best way to achieve that? I tried using several layers with Tiled map editor (Will attach images), but that did not went as planed. Searched google, but not found any useful information.

hot hazel
#

you need some kind of front to back ordering, likely just the y value of the bottom pixel

placid gate
#

Yeah, but libgdx does not have any of that

toxic wigeon
#

then you order them yourself... whichever you draw last is on top

hot hazel
#

make a Draw() call that puts everything into the list, sort by y, then pass that to the actual draw code

toxic wigeon
#

^this is specific to the game and also depends on stuff like layers or pivots of sprites

placid gate
#

With help of other person I manage to pull that of with tinkering rendering and shaders

toxic wigeon
placid gate
#

That I solved my issue

toxic wigeon
#

If you have questions and found a solution you should share your solution with others for you aren't the only one who will have that problem

#

and drop a little thanks for people that put in the effort to answer your specific question which might be easily googleable so you don't have to

final herald
#

ok so i have a weird problem with libgdx. i tried googling it in many different ways but i cant seem to find an answer
ok so i have a sprite. i am rendering it to the center of the camera (camera is at (0,0), so i render the sprite to (0,0)). it gets rendered to the center of the camera. perfect.
however, now i have to do the PPM conversion. i scale down the size of the viewport and my sprite and render it to the center of the camera (0,0). however, this time, the sprite gets rendered elsewhere, even though its coordinates are still (0,0) according to libgdx. below are some images - (first attachment is PPM = 1 ie no PPM conversion yet, second is PPM = 10)

#

i have no idea why this is happening

#

if anyone wants i can send the project root folder here so that they can see exactly what is going on

final herald
bright hazel
#

guys do you make your own tile map system in monogame? or you just use monogame extended

#

i was trying to make one using for loops running each frame and my rtx was at 50% usage

hot hazel
#

I made my own

#

only render what you can see

#

and if you really want to cut down on CPU usage, render one quad and calculate tiles in a shader

flat meteor
#

I need mobile game

hot hazel
#

?

flat meteor
#

Accept my request

#

@hot hazel

#

Plz

#

I'll invest in ur game

hot hazel
#

what?

flat meteor
#

U make games??

hot hazel
#

yes

flat meteor
#

So dm me

hot hazel
#

why?

flat meteor
#

Please

hot hazel
#

no

flat meteor
#

😫 😩

#

I m poor

#

But I'll help

#

I need help also

#

@hot hazel

hot hazel
#

what does that mean?

flat meteor
#

I'll explain but plz accept my request

#

.....

hot hazel
#

no

#

you can discuss it here

flat meteor
#

Why u r so rude

#

Okk

#

I need a noice mobile gaem

#

Game

#

👉👈

hot hazel
#

i don't know what that means

#

also why?

flat meteor
#

Noice=nice

#

Cause

#

I m

#

Gud

#

Guy

hot hazel
#

so?

#

anyway i need to sleep

flat meteor
#

Why it's 2:46 pm

hot hazel
#

its 2am here

flat meteor
#

Ohh

#

Okk

#

But can u give one

#

❓❔❓❔❓

#

@hot hazel tell

bright hazel
#

how do you guys do anti aliasing

#

?

#

monogame

hot hazel
#

alternatively you could write an fxaa/similar post process shader

bright hazel
#

Thanks

#

How can i use json? I want to make level for example...(monogame)

#

Like json files

hot hazel
#

depending on your .net version you have you might have System.Text.Json but more likely you can add Newtonsoft.Json from NuGet

bright hazel
#

Ok

#

Thanks

#

And

hot hazel
#

from there its up to you how to map data to a level

bright hazel
#

How do you do levels?

hot hazel
#

thats very much up to your game

bright hazel
#

So there isn't any editor

hot hazel
#

i mean there are editors yes but every game is different

#

monogame is not an engine

bright hazel
#

So its better to use something like json/xml

hot hazel
#

not sure what you mean

bright hazel
#

Like you make levels you make them in json right?

hot hazel
#

json is a data format

#

you could write it by hand but that would suck

bright hazel
#

Yeah

#

But what do you use

hot hazel
#

i wrote my own stuff

#

what kind of game are you trying to make?

bright hazel
#

Just having fun. i was wondering how celeste made their levels

#

*fun

hot hazel
#

you could probably use a tool like Tiled

#

theres a library called Monogame.Extended that I think has a parser for tiled's tmx files

bright hazel
#

Ok thanks

bright hazel
#

how can i fix this error?
The source file '/Documents/MonogameProjects/Project2/Project2/Content/../testing.tsx' does not exist! Documents\MonogameProjects\Project2\Project2\Content\mapTestUwU.tmx 1

bright hazel
#

Why does this json content reader doesnt work?

using System;
using System.Collections.Generic;
using System.IO;

using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;

using Newtonsoft.Json;

namespace JsonExtension
{

    [ContentImporter(".json", DefaultProcessor = "JsonProcessor")]
    public class JsonImporter : ContentImporter<Dictionary<string, dynamic>>
    {

        public override Dictionary<string, dynamic> Import(string filename, ContentImporterContext context)
        {
            context.Logger.LogMessage("Importing JSON file: {0}", filename);

            using (var streamReader = new StreamReader(filename))
            {
                JsonSerializer serializer = new JsonSerializer();
                return (Dictionary<string, dynamic>)serializer.Deserialize(streamReader, typeof(Dictionary<string, dynamic>));
            }
        }

    }

}


namespace JsonExtension
{
    [ContentProcessor]
    public class JsonProcessor : ContentProcessor<Dictionary<string, dynamic>, Dictionary<string, dynamic>>
    {
        public override Dictionary<string, dynamic> Process(Dictionary<string, dynamic> input, ContentProcessorContext context)
        {
            context.Logger.LogMessage("Processing JSON");

            return input;
        }
    }
}


namespace JsonExtension
{
    [ContentTypeWriter]
    class JsonTypeWriter : ContentTypeWriter<Dictionary<string, dynamic>>
    {
        protected override void Write(ContentWriter output, Dictionary<string, dynamic> value)
        {
            output.Write(JsonConvert.SerializeObject(value));
        }

        public override string GetRuntimeType(TargetPlatform targetPlatform)
        {
            return typeof(Dictionary<string, dynamic>).AssemblyQualifiedName;
        }

        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return "JsonExtension.JsonReader";
        }
    }
}
quiet ibex
#

@bright hazel its not that simple to make a hierarchial writer

#

and you'd be better off sending the json to a processor that converts it to a game-specific format and use that

#

no custom reader/writers needed then

bright hazel
#

ok

bright hazel
#

so how are you loading json files?

bright hazel
#

or do i even need to load them

#

coudnt i just put them in content folder and access them through path

bright hazel
#

can anyone help me understand matrix?

bright hazel
#

Guys why
1.Is there blur
2.The sprite disappears

my player code

using System.Diagnostics;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace worldHacking
{
    class Object
    {
        private Texture texture;
        private float weight;
        public Vector2 pos;
        private Vector2 velocity;
        private float rotation;
        private Color color;
        private bool applyGravity;
        public Object(Texture pTexture, float pWeight, Vector2 startPos, float pRotation, Color pColor, bool pApplyGravity)
        {
            texture = pTexture;
            weight = pWeight;
            pos = startPos;
            rotation = pRotation;
            color = pColor;
            applyGravity = pApplyGravity;
        }
        public void Update(GameTime gameTime)
        {
            if (applyGravity)
            {
                velocity.Y = 9.8f * weight * ((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000);
            }
            pos += velocity;
            Debug.WriteLine(pos);
            
            
        }
        public void Draw()
        {
            texture.Draw(pos, rotation, color);
        }
        
       
    }
}
quiet ibex
#

that's the whole purpose of the content pipeline

bright hazel
#

oh ok

hot hazel
#

esp when debugging

quiet ibex
#

debugs the same way as all other build tools

hot hazel
#

i mean content debugging not build tool debugging