Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all 6822 articles
Browse latest View live

Failed to load SDL library when running game on Mac

$
0
0

@Quasar wrote:

Hi all,

Thanks to some help from Kimimaru, I've been able to build my game to LInux using Mono's mkbundle and this tutorial: https://dotnetcoretutorials.com/2018/03/22/bundling-mono-with-a-net-executable-using-mkbundle-on-windows/

Unfortunately, I've come across an exception I haven't been able to fix on the Macbook we're using for testing.

I'm using the Monogame 3.7 Release.

I've tried mkbundling the game with both mono-5.16.0-osx-10.7-x64 and mono-5.16.0-osx-10.7-x64 with the same results. Near as I can tell from the error it's having trouble loading libSDL2-2.0.0.dylib, which is the Mac-specific replacement for SDL2.dll, but that's present and accounted for in the same folder as the executable.

What am I missing?

Exception follows:

Last login: Thu Oct 18 08:13:10 on ttys000
/Users/[REDACTED]/Desktop/Species\ ALRE/SpeciesOSX64 ; exit;
admins-MacBook:~ [REDACTED]$ /Users/[REDACTED]/Desktop/Species\
ALRE/SpeciesOSX64 ; exit;

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Sdl'
threw an exception. ---> System.Exception: Failed to load SDL library.
at Sdl.GetNativeLibrary () [0x00156] in <11a2afe69fa8407e8841850a70a7d30a>:0
at Sdl..cctor () [0x00000] in <11a2afe69fa8407e8841850a70a7d30a>:0
--- End of inner exception stack trace ---
at Microsoft.Xna.Framework.GamePlatform.PlatformCreate
(Microsoft.Xna.Framework.Game game) [0x00001] in
<11a2afe69fa8407e8841850a70a7d30a>:0
at Microsoft.Xna.Framework.Game..ctor () [0x00225] in
<11a2afe69fa8407e8841850a70a7d30a>:0
at SpeciesALRE.Game1..ctor () [0x0011c] in
<31ae773542af4bbaaa3eb6a1d4413be6>:0
at SpeciesALRE.Program.Main (System.String[] args) [0x00001] in
<31ae773542af4bbaaa3eb6a1d4413be6>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException:
The type initializer for 'Sdl' threw an exception. --->
System.Exception: Failed to load SDL library.
at Sdl.GetNativeLibrary () [0x00156] in <11a2afe69fa8407e8841850a70a7d30a>:0
at Sdl..cctor () [0x00000] in <11a2afe69fa8407e8841850a70a7d30a>:0
--- End of inner exception stack trace ---
at Microsoft.Xna.Framework.GamePlatform.PlatformCreate
(Microsoft.Xna.Framework.Game game) [0x00001] in
<11a2afe69fa8407e8841850a70a7d30a>:0
at Microsoft.Xna.Framework.Game..ctor () [0x00225] in
<11a2afe69fa8407e8841850a70a7d30a>:0
at SpeciesALRE.Game1..ctor () [0x0011c] in
<31ae773542af4bbaaa3eb6a1d4413be6>:0
at SpeciesALRE.Program.Main (System.String[] args) [0x00001] in
<31ae773542af4bbaaa3eb6a1d4413be6>:0
logout

[Process completed]

Posts: 1

Participants: 1

Read full topic


effect resource fails to load only in Release build

$
0
0

@jackmott wrote:

I have a monogame 3.6 project, running on windows, with the windows build. In debug mode my custom effect shader loads and works fine. When I do a release build, it says it cannot find the file. Anyone else have this problem and what is the solution?

update: upgrading to 3.7 did not resolve this

Posts: 3

Participants: 2

Read full topic

Game1 ArgumentNullEception

$
0
0

@MrMinemeet wrote:

So I tried to implement the tiled map now as importing works but now I get some System.ArgumentNullException when starting the game.

Here is my code if it helps you: https://pastebin.com/ZQZpZV6T

Would be very kind of you if you could help a noob again :slight_smile:

Posts: 1

Participants: 1

Read full topic

ScreenManager won't LoadContent()

$
0
0

@PatFerguson wrote:

I wanted to use Monogame.Extended.Screens.Transitions which is currently in the unstable branch, and the ScreenManager won't call LoadContent() on my Screen class.

ScreenManager says this:

public void LoadScreen(Screen screen)
                {
                    _activeScreen?.UnloadContent();
                    _activeScreen?.Dispose();

                    screen.ScreenManager = this;

                    if (_isInitialized)
                        screen.Initialize();

                    if (_isLoaded)
                        screen.LoadContent();

                    _activeScreen = screen;
                }

Shouldn't it only call LoadContent() or Initialize() if it is NOT already initialized or Loaded? Like this:

 if (!_isInitialized)
     screen.Initialize();

if (!_isLoaded)
     screen.LoadContent();

I want to continue to use Monogame Extended Screens and Transitions, and I could always copy the source file and make the corrections, but I would like to have the absolute latest version. Can anyone fix this and do a pull request so that this can work properly? I'm not sure how to do this myself.

Posts: 1

Participants: 1

Read full topic

Need help on monogame screen resolution and intersection

$
0
0

@Bhupesh_Behera wrote:

Currently in my game i want trying to move my object towards both x axis and y axis.As I also wanted to put it into center ,I have put a camera.Here is my Camera code-

  public class Camera
{
    public Matrix transform;
    public Viewport view;
    public Vector2 origin;
    Vector2 baseScreenSize = new Vector2(1136, 720);
    float horScaling ;
    float verScaling ;
    Vector3 screenScalingFactor ;
    public Camera(Viewport newView)
    {
        view = newView;
        horScaling = view.Width / baseScreenSize.X;
        verScaling = view.Height / baseScreenSize.Y;
        screenScalingFactor = new Vector3(horScaling, verScaling, 1);
    }

    public void update(GameTime gt, ball pl)
    {
        origin = new Vector2(pl.Position.X + (pl.ballRectangle.Width / 2) - 400, 0);
        transform = Matrix.CreateScale(1,1,0) *
            Matrix.CreateTranslation(new Vector3(-origin.X, -origin.Y, 0));
    }

}

and in Game1.cs file as usual in begin statement i am putting this-

 spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, cm.transform);
ba.Draw(spriteBatch, Color.White);
spriteBatch.End();

Here ba is the object of ball,its just have moving x and y functionalities.

In a separate begin,end statement ,I am drawing rest all of the objects-

spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, null, globalTransformation);

spriteBatch.Draw(mainMenu, new Vector2(0, 0), Color.White);
spriteBatch.Draw(mainMenu1, new Vector2(450, 100), Color.White);
spriteBatch.End();

Here Have applied globaltransformation to acheive independent screen resolution(similar codes like in Camera.cs).

Rest of the objects are working as expected,But intersections of camera object and rest of the objects is not working as expected. I guess this is due to resolution independency is not applied to Camera object(I am not sure).I have tried lot of codes after searching internet,but none of them is working as expected.Request all to help,I am stuck here from long time...

Posts: 1

Participants: 1

Read full topic

VP9 for videos

$
0
0

@SeriousMartin wrote:

Hi there,

has anyone tried to use VP9 encoded videos in their MonoGame project so far?
From what I can see it looks like a good idea:

  • very good encoding rate (comparable to or event better then h264)
  • no licensing costs (as far as I understand)
  • the libvpx implementation should work on windows, linux and android systems (https://github.com/webmproject/libvpx)

Posts: 1

Participants: 1

Read full topic

Load TiledMap in Array

$
0
0

@MrMinemeet wrote:

Hello,

Is there a way to load the numeric values of a tiled map into a integer array?
I want to use it as a "collision detection" and maybe some other stuff after it's loaded.

I saved the .tmx in CSV-encoding so it is kinda like an array in the file.

Posts: 2

Participants: 2

Read full topic

Custom Pipeline - One Input file to multiple output files

$
0
0

@emersont11 wrote:

Hi, I'm new to the whole custom pipeline thingy, but i want to know if there is a straightforward way (or a bodge) where I can take one input file (a tiled map that's infinite) and output it into multiple files (one for each chunk) so it can be built with the monogame pipeline tool

many thanks
Peter

Posts: 1

Participants: 1

Read full topic


How can I create a Shared project for iOS and Android?

$
0
0

@Fox9 wrote:

I use Visual Studio for Mac and I want to have everything in one solution. The iOS and the Android project. Both projects should share the same code(Game1.cs and new classes that I will add) but I want to have two Content projects, one for iOS and one for Android, because I don't know yet if I will use the same sprites on both platforms. Maybe it is necessary to use other sprites or sprites in a different resolution on one of the two platforms.

First, I created a Shared code project and after that I added the iOS and Android project to the solution. What should I do now? What are the next steps? How can I set up the projects so that I can use the shared code in both projects and one Content project for each platform?

Posts: 1

Participants: 1

Read full topic

Alternatives to Winforms for Exception Handling?

$
0
0

@Quasar wrote:

Hello all,

Winforms is giving me grief.When I package my game with mkbundle it works on Linux, but I get this error on Mac when my exception-handling dialogs (made with winforms) try to initialize:

System.TypeInitializationException: The type initializer for
'System.Drawing.GDIPlus' threw an exception. --->
System.DllNotFoundException:
/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/libgdiplus.dylib
at(wrapper managed-to-native)
System.Drawing.GDIPlus.GdiplusStartup(ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)

I need to get this working, or find a replacement.My winform dialogs aren't complex, but the richtextbox on them allows the user to select and copy the stack trace to clipboard, something I've had trouble replicating elsewhere.They're also capable of displaying (on windows at least) exceptions which prevent the OpenGL window from opening, which is why I can't just spritebatch it to the main game window.

Any help?

Posts: 2

Participants: 2

Read full topic

Pipeline Tool: Import texture with alpha (other format than PNG)

$
0
0

@semo wrote:

Hi community,

I use Adobe Photoshop for creating my textures. But Phothoshop has one big issue with PNG images: it doesn't save color pixels in places, where alpha channel is 0. In other words: it doesn't save alpha channel, only layer transparency. This is unacceptable for game textures, of course.

So, I want to use TGA or PSD, or other rgba format. But it seems, Content Pipeline Tool (3.6.0.1625) imports all of them without alpha. Is it because I have old version, or it is bug, or feature?

Thank You.

Posts: 1

Participants: 1

Read full topic

Monogame build from sources

$
0
0

@Jim_Tench wrote:

Just wanted to say, what a breeze it was to build! I used the stock build with visual studio and didn't get the pipeline gui tool, this left me with no option other that yank it all down from git. Worked a treat, top work guys!

I'm impressed...

Posts: 1

Participants: 1

Read full topic

Draw size and rotation

$
0
0

@gebruikersnaam wrote:

Hello
everyone,

I have
worked with Monogame a couple of times. Each time I try to make a game with
more gameplay and more programming challenges.

I have rotated
an image, a process that was harder than I expected, but how do I control the
image size? I wasted hours on my collusion system, because I didn't realize the
image size was not controlled by me.

So, my
question is: how can I flip an image and chose the image size?

I currently
have this:

SpriteBatch.Draw(Enemy1, new Vector2(enemy.Position.X, enemy.Position.Y), null, Color.White, (float)Math.PI, new Vector2((float)enemy.Position.Width, (float)enemy.Position.Height), 1, SpriteEffects.FlipVertically, 0);

Thanks a head of time.

Gebruikersnaam

Posts: 2

Participants: 2

Read full topic

Suppress Game Logic Updates

$
0
0

@EricRetro wrote:

Hi,

I have a situation in a flip screen game where sometimes, changing room can take longer than expected, and I don't want the game to play catchup with the logic when the new room is ready. So with IsFixedTimeStep set to false, is there a way to suppress updates for a short while? I'm thinking it's something to do with ResetElapsedTime, but if I call that I get an object not set error.

Thanks ;o)

Posts: 3

Participants: 2

Read full topic

How to bend sprite into curve path?

$
0
0

@MozGaming wrote:

Hi All,

First or all, this is my first time using Monogame Framework. Can someone give me some direction, how to bend sprite or 2D texture into curve path?

In Unity we can render texture in curve using Mesh Filter, and because this is my first time using Monogame, I want to try to port my dynamic wire from Unity to Monogame. Anyone can help me? I also want to use Nez which developed by @prime31

This is my dynamic wire: https://twitter.com/i/status/1049494388928212993

Thanks in advance

Posts: 3

Participants: 2

Read full topic


Content importer dependent on another one.

$
0
0

@Remi_Boullerne wrote:

Good Morning/Afternoon !

First, for the context, I'm working on porting a game that was made on XNA 3.1 to MonoGame, with the goal to publish in on Mac/Linux and consoles. The game's project is quite heavy so I'm looking for solution that allow me to rework the project's files as few as possible.

I have an issue with the custom Content Pipeline Importer system. The project have two Content Importer projects that use Monogame.Framework.Content.Pipeline, let's call them B(ase) and R(eferencing). R is referencing B and using it a lot and deeply. When I build, B.dll is present in R's build folder alongside R.dll. Now when I configure the .mgcb file, I add the two assembly as references to use their importers but only the importers from B are available. The ones from R doesn't appears in the importer/processor fields.

In R, I tried to strip out the files that use B's classes and built again, and this time both B and R's importers where present (minus the ones I stripped out), so I guess it failed the first time because R is referencing B but the Pipeline Tool can't get a hold on B.dll when loading R's importers.

I didn't see any topic about that, so here I am, looking for assistance. :slight_smile:

One simple solution would be to make B a shared project or simply merge it with R, but I still want to wait a bit for answers in case it could be solved by an additional keyword somewhere or another way to reference my .dlls.

With regards.

Posts: 1

Participants: 1

Read full topic

GraphicsDevice.GetBackBufferData is sloooow

$
0
0

@dmanning23 wrote:

Hi all! So what I've been working on is a thing that records gameplay, and then at the end of the game compresses it to an animated gif, which the player can then share on social media. It's coming along great and it's nearly there, but I've ran into a few wrinkles...

The way I'm currently recording gameplay is by grabbing a screenshot using GraphicDevice.GetBackBufferData(). It works great on desktop because there is horsepower to spare, but on android/iOS the performance is in the toilet. As soon as I turn the recorder on, I get a janky frame everytime it calls GetBackBufferData. I tried to cheat and wrap it in Task.Run to pitch to a separate task, which fixes the performance issue but on opengl platforms it grabs a blank screen.

My next step is to try spinning up a dedicated BackgroundWorker to grab screenshots, maybe that will work but I don't really have my hopes up. Does anyone have a better idea? Is there some other technique that would be better than GetBackBufferData? Is there a way to speed it up?

You can check it out here if you want:
https://github.com/dmanning23/MonogameScreenTools

and here is a full-blown example game using it:
https://github.com/dmanning23/MonogameScreenToolsExample

Cheers!

Posts: 1

Participants: 1

Read full topic

Monogame Cross-Platform project and Steam

$
0
0

@Pontus_Persson wrote:

Hey, so i've been trying to port my game using the cross-platform project template. I can get it running on Windows but when i try it on Linux with monokickstart i only get an error saying "System.DLLNotFoundException: steam_api64"
It's weird that i get this error because steam_api64.dll exists in the same folder as the .exe. Has anyone ran into a similar problem and got a fix for it?

Here's the full error btw
Unhandled Exception:
System.DllNotFoundException: steam_api64
at (wrapper managed-to-native) Steamworks.NativeMethods:SteamAPI_RegisterCallback (intptr,int)
at Steamworks.Callback
1[T].Register (Steamworks.Callback1+DispatchDelegate[T] func) [0x00053] in <e2c16db8661b4ac2b840d9f3e82aff69>:0
at Steamworks.Callback
1[T]..ctor (Steamworks.Callback1+DispatchDelegate[T] func, System.Boolean bGameServer) [0x00033] in <e2c16db8661b4ac2b840d9f3e82aff69>:0
at Steamworks.Callback
1[T].Create (Steamworks.Callback1+DispatchDelegate[T] func) [0x00000] in <e2c16db8661b4ac2b840d9f3e82aff69>:0
at VelvetGuard.Game1..ctor (System.String[] args) [0x0012a] in <e36ec2cf99f34748979e6c100bdbdbfe>:0
at Velvet_Guard.Program.Main (System.String[] args) [0x00001] in <76143df95a4f4a76962cd91be21bce69>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: steam_api64
at (wrapper managed-to-native) Steamworks.NativeMethods:SteamAPI_RegisterCallback (intptr,int)
at Steamworks.Callback
1[T].Register (Steamworks.Callback1+DispatchDelegate[T] func) [0x00053] in <e2c16db8661b4ac2b840d9f3e82aff69>:0
at Steamworks.Callback
1[T]..ctor (Steamworks.Callback1+DispatchDelegate[T] func, System.Boolean bGameServer) [0x00033] in <e2c16db8661b4ac2b840d9f3e82aff69>:0
at Steamworks.Callback
1[T].Create (Steamworks.Callback1+DispatchDelegate[T] func) [0x00000] in <e2c16db8661b4ac2b840d9f3e82aff69>:0
at VelvetGuard.Game1..ctor (System.String[] args) [0x0012a] in <e36ec2cf99f34748979e6c100bdbdbfe>:0
at Velvet_Guard.Program.Main (System.String[] args) [0x00001] in <76143df95a4f4a76962cd91be21bce69>:0
AL lib: (EE) alc_cleanup: 1 device not closed

Posts: 2

Participants: 1

Read full topic

Iphone XsMax resolution

Move SpriteBatch to 3D-Space Coordinate

$
0
0

@ronnycsharp wrote:

Hi,

I want to draw text and an image on a specific position in 3D Space. The scene is rendered in 3D and I want to display a rendered 2D Text and an image on a XYZ-Coordinate.

I have the World, View, Projection Matrices from the scene and the ViewPort. I don't want to render a real 3D-Font and I also don't want to display the image with texture vertices.

I've tried some matrix multiplications with the transformation matrix and I also tried to use the basic effect as parameter for the begin-method. But non of them worked for me.

    eff.World = Graph3DGame.Current.currentWorld;
    eff.View = Graph3DGame.Current.currentView;
    eff.Projection = Graph3DGame.Current.currentPerspective;

    spriteBatch.Begin(0, null, null, null, null, eff);
    spriteBatch.DrawString(Fonts.Math, "hello, world!", new Vector2(100,100), Color.Blue);
    spriteBatch.End();

Hope anyone could help.

Posts: 3

Participants: 2

Read full topic

Viewing all 6822 articles
Browse latest View live