• Content count

  • Joined

  • Last visited

Community Reputation

145 Neutral

About DapperDave

  • Rank
  1.   That made things blurry but I don't see the artifact anymore so you are on to something!
  2.   Yes. That isn't the issue. Coincidentally the person behind the website you linked to there has already looked at my issue. Small world!
  3. There is at least 1px of padding between the pigs and the rect borders.
  4. I have a 2D game (C#, XNA) that uses a 3D effect. Below you can see a battle against 3 pigs. These pigs look 2D but they are actually drawn using 3D quads. This is so I can invoke a tilting effect (when they get hit, they tilt back as if they are wooden cut outs).   I have noticed recently that when they are drawn in the neutral position, there is a strange and inconsistent graphical artifacting bug that occurs sometimes. What’s odd is that, after many experiments, I’ve found that the artifacting is related to WHERE the pigs are drawn on the spritesheet.     In the below image, you can see where each pig comes from within the spritesheet. The first pig has a lot of artifacting around the feet, the second not so much, and the third one is perfect. These pigs are the same in every way except where they are drawn from the spritesheet (which is 1024x1024 png).  So far I the artifacting appears more severe when a the sprite rect is close to an edge, but I’m not entirely sure.   Strange huh? I fear that this isn’t something that I will solve and the best solution I have is to just draw these pigs using the regular spritebatch while they are in the neutral position and switch them back to 3D when they are tilting. But I thought it was worth posting here in case any obvious solution jumps out to anyone.   Here is the most relevant code (removed are the many functions that handle the tilt effect).   (I kept the below images in their native resolution, which is very small and difficult to see the artifacting I’m referring to. But I didn’t want to create additional confusion by scaling them for visibility.)     Image is on pasteboard.co   Update:  Here I replaced the pigs with checkerboard (black and white 1px with green outline issues) and the issue becomes clearer. You can see a triangle where things are getting stretched here. Again, the third grid is perfect just like the third pig was perfect and the issue somehow relates to where images are placed on the png. And any idea you come up with would have to explain this difference.   checkerboard on pasteboard.co
  5. Hey guys, I have been porting a game made in XNA, a 2D RPG, to PSM using Monogame.  Unfortunately, I use a simple 3D effect that cannot be translated because Monogame did not write translation code for the BasicEffect class.   The effect is a simple 3D manipulation used in battle.  I know almost nothing about 3D coding so it was a struggle to get this work in XNA to begin with.   Here's how it works.  Enemies in battle don't move and are just standard sprites from a spritesheet, like this:   The enemy sprite is like a wooden cut out from a shooting gallery.  Now certain actions can move it around.  For example if you hit the enemy it will tilt back and forth.       Now the logic behind how this works is very simple, although it was difficult for me to find the right syntax.  I'm simply manipulating the verticies that draw the sprite.  For example, if I want it to look like it's tilting back, I simply move the top left vertex down and left and the top right vertex down and right.   Here's what the code for tilting looks like in my XNA code. public void TiltBackward(GameTime gameTime) { if (transitionTimer >= tiltForwardInterval) { transitionTimer = TimeSpan.Zero; TiltFinished = true; } else { transitionTimer += gameTime.ElapsedGameTime; gpuVertices[0].Position.X = startVertices[0].X + (((float)entity.Width * (float)bits / 4f) * (float)Math.Min(1,(transitionTimer.TotalSeconds / tiltForwardInterval.TotalSeconds))); gpuVertices[1].Position.X = startVertices[1].X + (((float)-entity.Width * (float)bits / 4f) * (float)Math.Min(1,(transitionTimer.TotalSeconds / tiltForwardInterval.TotalSeconds))); gpuVertices[0].Position.Y = startVertices[0].Y + (((float)entity.Height * (float)bits / 4f) * (float)Math.Min(1,(transitionTimer.TotalSeconds / tiltForwardInterval.TotalSeconds))); gpuVertices[1].Position.Y = gpuVertices[0].Position.Y; } //GetShadowVerticies(); } The XNA code that draws it uses syntax that I don't fully  underestand, like rasterized states, index buffers, basiceffect passes.  Here's what that looks like in XNA. basicEffect.Texture = image; basicEffect.VertexColorEnabled = true; basicEffect.TextureEnabled = true; //Will make colors black instead of red graphics.Indices = indexBuffer; graphics.SetVertexBuffer(vertexBuffer); graphics.RasterizerState = rasterizerState; foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) { pass.Apply(); DrawTriangleStrip(); } private void DrawTriangleStrip() { graphics.DrawUserIndexedPrimitives<VertexPositionColorTexture>( PrimitiveType.TriangleList, gpuVertices, 0, gpuVertices.Length, shortUshortConversion(edgeFaceList),//*edgeFaceList, 0, 2); } So now I need to simply translate this code to the PSM native language.  This is a difficult task for someone who barely understands the original syntax, has been using Monogame to port, and doesn't really understand 3D coding to begin with.   I've looked at all the examples and looked up some things in the SDK.  It seems like to pull this off all I would need to do is manipulate the quad points.  Unfortunately, those are read only and cannot be changed manually.     I understand the logic, I just can't figure out the syntax.  This is a problem where anyone with even a passing familiarity in 3D coding for PSM could tell me exactly how to do this in seconds.  But I've spent days trying to figure it out without any success.  I'm hoping such a person can throw me a bone. 
  6. Thanks. I'll let you know how it goes.
  7. Thank you for the insight. I have one idea I was considering so maybe you can give me your opinion on whether you think it will help the situation. I'm wondering if instead of using these enormous xml/xnb files I could instead represent the same data in a much smaller text file like this http://pastebin.com/raw.php?i=czJk6pbv In that example of a 6x4 map, the tiles are delimited by commas, the rows of tiles are delimited by line breaks, and the map layers are delimited by double line breaks. It's the same amount of data, but it's represented in far fewer characters. So the questions is, do you think this would load any faster if I did it this way?
  8.   If I understand you correctly, I may already be doing this. If my MapData is a data structure. When the game is run, this data (in XNB) format is loaded into MapData. Thanks, I will look into this. Although, I'm not sure if it applies since I'm loading XNBs. I don't fully understand how it all works but you've given me something to go on.
  9. I'm having trouble with loading times on the Vita and was looking for general suggestions.  I'm sort of stuck as I lack competency in xml reader coding and have a tenuous grasp of content loading in general.   Some background, I'm porting a game from XNA to PSM using Monogame.  So my XMLs are being loaded as XNB custom data types like so:   MapData mapData = Content.Load<MapData>(@"Game\Levels\Maps\" + name);  Now to be fair, the xmls for these maps are enormous to begin with.  One of my larger maps is 4.87 mb as an XML, 257 KB as an XNB and takes about 35 seconds to load (which is way too long for a 2D RPG).   I'll show you a typical map data xml file so you can get an idea of what these long loading files look like http://pastebin.com/raw.php?i=rs6SqTd5   I suppose I either need to find to find a faster way to load them or else find smaller way to represent map data.  I'm hoping there's an solution for the former.
  10. Thanks for your help. But Microsoft does not give XNA devs the same access to player data that other games like Mass Effect does.  It is not within the XNA framework.  I've asked on other forums and it seems the only option is possibly a password system.   As for PC, it may be possible it I could simply specify the directory where the save file is stored.  But I'm having trouble finding the correct syntax for that.  I can save in IsolatedStorage or in SavedGames but I cannot find a way to specify the sub directory.
  11. It’s a tough question.  One I have casually asked before, but now I must seriously consider how this could possibly be done.   I don’t know much about coding save systems.  I figured mine out for my game about 7 months ago.  Starting the game for the first time creates a folder in windows Isolated Storage (with some gobbledegook name).  Saving creates an xml file in this folder with all the saved data.  The player can then load this save file when resuming the game.  (I can include this code if necessary). Simple enough although I don’t exactly have a clear grasp on how it all works.   But back to the burning question before I lose your attention.  I want the user to be able to play a different game, a sequel, using their old save file (so they can keep all the experience, equipment, etc. learned).  The save files are quite large (500KB) as this is an RPG. It might be doable on Windows.  I might be able to better control where the save file is created and where it is loaded from with both games. On the Xbox, it is an entirely different matter.  From what I’ve heard, there is simply no way to do this.  I’m hoping that isn’t true.  Maybe through some kind of online storage?  Or perhaps a complex password system?   Has anyone ever attempted such a thing before?
  12. Need help transforming a 2D image

    12 hours later and no luck. I tried everything with "quads" but couldn't get the effect working. I would try GodofOdd's final solution in this thread http://forums.create.msdn.com/forums/t/37143.aspx but I can't make heads or tails of his code.
  13. Need help transforming a 2D image

    [quote name='laztrezort' timestamp='1342575894' post='4960289'] Not 100% sure on how you are transforming the image, but it looks like a series of skews. If you can determine the exact operations needed, then it would boil down to one or more transforms, likely done with a transform matrix. For example, see here: [url="http://forums.create.msdn.com/forums/p/37143/215098.aspx#215098"]http://forums.create...098.aspx#215098[/url] Perhaps this is already your intention, but I suggest considering on providing this functionality as a stand-alone tool, since some (many?) sprites would likely need some artistic touch-up after transformation. If you go this route, you could also consider writing scripts for, say, Gimp - I believe it provides a python scripting interface. [/quote] Thanks. You seem to understand what I'm going for, so I'm going to look into your suggestions and report back
  14. EDIT: Solved...at the moment Working on a game in XNA with C#. I posted this in the creator's club forum and didn't get much help so I thought I'd give it a shot here. For our RPG, we have enemy sprites that spin and fall down when dodging, hit and defeated - like in an old west shooting gallery. You can check out the effect in this video demonstrating our combat system: [media]http://www.youtube.com/watch?v=DXFfeyBDlpA&feature=player_embedded[/media] It's a neat effect but there's nothing fancy going on here. This is done simply by manually distorting the original sprite in photoshop and creating an animation. Here is an enemy spritesheet: [img]http://www.experimentalgamer.com/images/Weezler.png[/img] The problem is, it takes a long time to manually create these animations and it's prone to human error. It would be fantastic if there was a way to code the same effects from the original sprite (in 2D). I looked into it before, but gave up as it seemed too complex for me. However, faced with how long it takes to do manually, I thought it would be worth a shot to see if anyone can help me out and point me in the right direction to code the effect.