As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

XNA Indie Games! Now with 80pt ($1 USD) game option!

15657585961

Posts

  • Options
    RiemannLivesRiemannLives Registered User regular
    edited March 2010
    Hey all, I was going to start tinkering with an XNA project this weekend (which will probably get shelved like all the others when work gets busy again) and am thinking about where to obtain a bunch of 2d artwork. Yes, I know the short answer is "give lots of cash money to an artist". However, the kind of stuff I need is very generic (details below). Do any of you know of any free-for-commercial-use or reasonably priced libraries of artwork (Artwork has value and I am fine with paying for it, but obviously do not want to spend more than $100 here) with stuff along the following lines:

    1) Icons for real-world commodities in the style of Civilization, Railroad Tycoon, The Settlers or older Microprose strategy titles like Master of Orion 2, Master of Magic etc... EG: Icons representing "resources" in a strategy game like timber, lumber, iron, steel, wheat, bread, corn. Also for people like laborers or nobles. Think the kind of stuff you see on the City Management screen in a Civilization game. Medieval or Renaissance in technology level.

    2) Artwork for map tiles. Forest, river, rocky ground, fertile ground, cultivated fields and such. Also some tiles representing houses of various levels of affluence (from small huts up to lavish mansions) would be nice.

    So, anyone have any leads on that kind of thing?

    I'm just throwing this out there... would you be interested in hiring or collaborating with someone to make graphics for you? I'm pretty good at making icons and "representative" graphics, and depending on the style you wanted I could do all of the tiles and whatnot you need too.

    In terms of hiring, I am not willing to invest the kind of cash in the project that would be fair cash compensation for an artist (from graphic designers I know that would be at least $25 an hour). It wouldn't be fair to advertise for artists when I don't want to put up real money.

    As for collaberation, I doubt someone would want to. This project is in it's very early stages and has high probability of never getting done. My day job can be quite demanding (I am a programmer - Senior UI Developer) and it has to come first in priority.

    Since the stuff I am looking for is fairly generic I was hoping there might be art libraries available at a reasonable price (or free).

    RiemannLives on
    Attacked by tweeeeeeees!
  • Options
    mntorankusumntorankusu I'm not sure how to use this thing.... Registered User regular
    edited March 2010
    In terms of hiring, I am not willing to invest the kind of cash in the project that would be fair cash compensation for an artist (from graphic designers I know that would be at least $25 an hour). It wouldn't be fair to advertise for artists when I don't want to put up real money.

    Well, I'm saying I'll do it for peanuts if you can't find anything free.

    This offer is available to anyone who is working on a game and needs icon-type graphics or textures or basically anything besides character art. I just want a game project to work on where I don't have to do any dang programming.

    mntorankusu on
  • Options
    mspencermspencer PAX [ENFORCER] Council Bluffs, IARegistered User regular
    edited March 2010
    Well there was one other thing I wanted to mention, and it'd be really easy to interpret this in an offensive or derisive way.

    There are many renaissance men in the world who can do both art and writing, or art and programming. If you don't have a lot of background in programming, some of the concepts you'll want to understand can be a bit abstract, a bit difficult to communicate. That doesn't mean they're beyond you -- it just may take more time and effort than you were prepared to commit.

    Second thing: I'm sitting here realizing I'm not totally qualified to help with this from memory alone. I forgot a bunch of stuff, and will need to go home and get my C# book to remind myself of some of the nuances. (I'm at work for another couple hours.)

    I can summarize the concepts I would want to help you learn though. Also -- this is debatable -- I would want to help you learn about threading in order to make better use of event handlers. Strictly speaking you don't really need to learn that, but I think it helps. So, in overview form:

    First you need to understand function execution in different contexts. A function is called with inputs and it returns some output, sure, but what is the environment the function executes in?

    Some functions are context-free: they take some input, they process that input using only their own storage and only other context-free system resources. Some functions use global resources, where there is only one shared version of . . . something . . . that will have effects on other parts of the system when changed. Some functions use context specific to the function caller, and will depend on the object or context that called the function.

    Next you would need to understand program flow from a multi-threaded perspective. Traditionally we think of the program as having one entry point, that program runs until it terminates, and only one thing happens at a time. I promise multithreaded programs aren't a HUGE leap. You don't have to think with portals to understand this, or bend spoons with your mind. But you kinda have to keep it in your mind that there is global state and machine state, there's thread-local state, and from each thread's perspective there's "stuff I can work on without worry" and "stuff I can work on that *gasp* maybe someone else is trying to work on also."

    Next you would learn about thread synchronization primitives and the techniques used to keep threads from fighting. Essentially you have to plan for the worst, where two threads have been told to work on the same resources, and maybe bad things will happen and the two threads will step on each-others' toes. There are ways to lock and unlock resources, or use a special operating-system-controlled counter called a semaphore, so you keep threads separate. There's actually a whole bunch of computer science around threads and the problems that can happen -- priority inversion for example killed one of our Mars rovers if I remember correctly -- but you don't need to learn these right away I don't think.

    Next you would learn about how event dispatching works when you AREN'T making your own event handlers. . . . I don't remember so much about this and need to go read my C# book again. But there's this idea that you provide functions that get called when events happen already: Update(), Draw(), Initialize(), etc. Something happens (GameTime clock tick probably) and one of your functions gets called again. Maybe something weird happens and the event dispatcher calls some other function instead of calling yours. When does this happen? What's the logic behind figuring out which function should get called next?

    Then I think you'd be ready to learn about adding event handlers. You make your own function that's supposed to run when an event happens. Do you have your function run in the main system thread, so all other execution stops until your event handler finishes? Will that hurt your frames per second? Or maybe your event handler will create a thread (easier than it sounds I promise) and let that separate thread do its own thing, so your main program loop can get back to update and draw and stuff as fast as possible.

    If you go the threaded approach, which I recommend: how do you handle the case where events are coming in faster than your event handler can handle them, so you have multiple event handler instances trying to do the same thing at the same time? (Hint: semaphores) Are there any recommended tactics to use if you're using a thread to change things the update() loop is going to care about, but you don't want to accidentally change them while the update() loop is in the middle of looking at them? (Yes but I don't remember them off the top of my head.)


    So ITT we all learn Spencer isn't as smart as he thought he was a few hours ago. Also LOL tl;dr. Also I was halfway trying to scare you off and halfway hoping you don't get scared so easily and I can show you some cool stuff.

    mspencer on
    MEMBER OF THE PARANOIA GM GUILD
    XBL Michael Spencer || Wii 6007 6812 1605 7315 || PSN MichaelSpencerJr || Steam Michael_Spencer || Ham NOØK
    QRZ || My last known GPS coordinates: FindU or APRS.fi (Car antenna feed line busted -- no ham radio for me X__X )
  • Options
    gjaustingjaustin Registered User regular
    edited March 2010
    Delzhand wrote: »
    Delzhand wrote: »
    Now, I've never seen "+=" as an assignment operator before.

    Events are an exception to the rule, but "X += Y" generally is the same as "X = X + Y". Similarly, there are -=, *= and /= operators, and all of them can be used on types that you can apply that operation on. For example, instead of writing something like
    Position = Position + Movement;
    

    you could write
    Position += Movement;
    

    Okay, it was dumb of me to write it that way. I am familiar with +=, but not in use for Events. I use it all the time.

    Edit: :o
    Events... a powerful and easy to use tool that does exactly what I need? How did I not know about this?

    Here's how I think about += in in terms of EventHandlers, so that it makes sense to me:

    You have an existing list of two event handlers called when the event triggers. You use += to add another to the list. If i=2, then i+=1 gives you 3. Later, you can use -= to remove the handler, which is important to prevent memory leaks (though it rarely comes up in XNA).

    As for passing parameters into an EventHandler, that's what the EventArgs are for. An example from my Save/Load manager code that I've been posting:
    // Includes a Data property that contains the results of the Load operation
        public class LoadEventArgs : EventArgs
        {
            public Object Data { get; set; }
    
            public LoadEventArgs(Object data)
                : base()
            {
                Data = data;
            }
        }
    

    gjaustin on
  • Options
    StargliderStarglider Registered User regular
    edited March 2010
    This offer is available to anyone who is working on a game and needs icon-type graphics or textures or basically anything besides character art. I just want a game project to work on where I don't have to do any dang programming.

    You should post on the XNA forums, there are always programmers looking for artists to work with.

    Do you have an online gallery up anywhere?

    Starglider on
  • Options
    DelzhandDelzhand Hard to miss. Registered User regular
    edited March 2010
    As we approach the natural death of the thread, can I suggest going forward that there be separate threads for XNA development and XNA released? Maybe it's a call for a mod, but it seems like people might miss out on great new XNA games if they think this thread is just talk about delegates and save files and such.

    Delzhand on
  • Options
    redraptorredraptor Registered User regular
    edited March 2010
    Does anyone know the sales figures on Soulcaster? Or where I would get them when they become available?

    redraptor on
  • Options
    RainbowDespairRainbowDespair Registered User regular
    edited March 2010
    Unless the developer publicly discloses them (generally here: http://forums.xna.com/forums/t/28044.aspx?PageIndex=1), you just have to guess based on download rank & number of ratings.

    RainbowDespair on
  • Options
    EriosErios Registered User regular
    edited March 2010
    solsovly wrote: »
    agoaj wrote: »
    Delzhand wrote: »
    I wish some of you guys lived near me. I need to sit with someone and watch them play an SRPG so I can constantly ask questions like "why did you select that ability", "why did you target that tile or unit", "why did you move to that location".

    I'm building AI. I'm good at SRPGs, I'm good at analysis, but I've been playing SRPGs for so long that it's hard to analyze my intuition.

    Get some testers who will record themselves and vocalize their thoughts.

    Go on gamefaqs and check out the faqs and forums. I would love a "hard mode" AI setting that had coordinated attacks or some sort of threat assessment.

    Coordinated attack scenario:

    Enemy:
    2 Archer does 1 HP damage
    Mage does 2 HP damage AOE

    You:
    2 Knights that have 3 HP each

    It's the enemies turn and the turn order is archer 1, archer 2, mage.
    Most SRPGs AI would go as follows:
    1) Enemy Archer 1 attacks Knight 1 bringing his HP to 2.
    2) Enemy Archer 2 attacks Knight 1 bringing his HP to 1.
    3) Mage AOEs Knight 1 to -1 and Knight 2 to 1.

    The "best" attack should have been each archer attacks a different knight and the mage should finish them all off. The AI in almost every "Tactics" game is so dumb that I hardly ever have to really think about my moves in SRPGS.

    Late to the party, but I suppose that a Lagrange multiplier problem could solve this, making for more effective AI. Basically, it would maximize expected kills constrained by expected damage, and then find the appropriate allocation. There are a few spanners in the works, like movement and non-attacking units, like healers and buffers. I'm pretty sure this would involve the computer making a larger analysis than usual and may take up a greater number of resources. Also, my method is slightly brute-force, as I am a novice at programming and have forgotten a large amount regarding arrays etc.

    Erios on
    Steam: erios23, Live: Coconut Flavor, Origin: erios2386.
  • Options
    redraptorredraptor Registered User regular
    edited March 2010
    Is download rank info available online?

    redraptor on
  • Options
    WitchsightWitchsight Registered User regular
    edited March 2010
    Witchsight wrote: »
    Has anyone here tried out Dungeon Adventure?

    Botp'd 10 days ago!

    After playing the demo over and over, i cant quite decide what i think of it. It seems very basic and lacks much of the randomness and flair of any other roguelike. Granted ive only played Dorfortress in depth, but even its adventure mode seemed to engage me more with its descriptions and body part maiming...

    Can anyone comment on how the full version holds up, or is it just more of the same?

    Witchsight on
    Witchsight.png
  • Options
    gjaustingjaustin Registered User regular
    edited March 2010
    Delzhand wrote: »
    As we approach the natural death of the thread, can I suggest going forward that there be separate threads for XNA development and XNA released? Maybe it's a call for a mod, but it seems like people might miss out on great new XNA games if they think this thread is just talk about delegates and save files and such.

    I'm not sure either thread would get enough traffic if we split them out that way.

    gjaustin on
  • Options
    RainbowDespairRainbowDespair Registered User regular
    edited March 2010
    gjaustin wrote: »
    Delzhand wrote: »
    As we approach the natural death of the thread, can I suggest going forward that there be separate threads for XNA development and XNA released? Maybe it's a call for a mod, but it seems like people might miss out on great new XNA games if they think this thread is just talk about delegates and save files and such.

    I'm not sure either thread would get enough traffic if we split them out that way.

    Yeah, that's my fear as well.

    In BoDVII news, I promised my wife that we'd get this game into playtesting by the end of the week. Should be doable since I have a light workweek.

    RainbowDespair on
  • Options
    ArchsorcererArchsorcerer Registered User regular
    edited March 2010
    Hey all, I was going to start tinkering with an XNA project this weekend (which will probably get shelved like all the others when work gets busy again) and am thinking about where to obtain a bunch of 2d artwork. Yes, I know the short answer is "give lots of cash money to an artist". However, the kind of stuff I need is very generic (details below). Do any of you know of any free-for-commercial-use or reasonably priced libraries of artwork (Artwork has value and I am fine with paying for it, but obviously do not want to spend more than $100 here) with stuff along the following lines:

    1) Icons for real-world commodities in the style of Civilization, Railroad Tycoon, The Settlers or older Microprose strategy titles like Master of Orion 2, Master of Magic etc... EG: Icons representing "resources" in a strategy game like timber, lumber, iron, steel, wheat, bread, corn. Also for people like laborers or nobles. Think the kind of stuff you see on the City Management screen in a Civilization game. Medieval or Renaissance in technology level.

    2) Artwork for map tiles. Forest, river, rocky ground, fertile ground, cultivated fields and such. Also some tiles representing houses of various levels of affluence (from small huts up to lavish mansions) would be nice.

    So, anyone have any leads on that kind of thing?

    http://opengameart.org/

    Archsorcerer on
    XBL - ArchSilversmith

    "We have years of struggle ahead, mostly within ourselves." - Made in USA
  • Options
    slash000slash000 Registered User regular
    edited March 2010
    Opengameart might work but just as a reminder it's still subject to licensing. That site in particular, the art varies, but it seems that most licenses on that site allow you to use the art in commercial projects as long as you also end up releasing your source code of your project for free, and/or upon the condition that others can also use your source code for free. There also seem to be a fair amount of creative commons licenses on there, requiring author attribution.

    If any of that is cool with you then it's probably a good source.

    slash000 on
  • Options
    floatstarpxfloatstarpx Registered User regular
    edited March 2010
    hey all,

    our new game STICK 'EM UP is online on marketplace today!
    it's a 1-4 player co-op/vs stickman extravaganza. vehicles, explosions, awesomes, etc...

    xboxboxart.jpg
    screen2_Web.jpg
    screen3_Web.jpg

    marketplace link (download game/trial to X360)

    hope you guys like it.

    floatstarpx on
    Stick Unleashed - sticktacular stick battles, with vehicles, spaceships, wall-jump madness, multiple weapons and a built in level editor!! (co-op/vs 1-4 player X360)
    Also - I <3 Excruciating Guitar Voyage.
  • Options
    gjaustingjaustin Registered User regular
    edited March 2010
    gjaustin wrote: »
    Delzhand wrote: »
    As we approach the natural death of the thread, can I suggest going forward that there be separate threads for XNA development and XNA released? Maybe it's a call for a mod, but it seems like people might miss out on great new XNA games if they think this thread is just talk about delegates and save files and such.

    I'm not sure either thread would get enough traffic if we split them out that way.

    Yeah, that's my fear as well.

    In BoDVII news, I promised my wife that we'd get this game into playtesting by the end of the week. Should be doable since I have a light workweek.

    So I have an idea that might help with Delzhand's concern (specifically that all the programming talk scares people off).

    Have you considered making a nice pretty OP, changing the title every so often to mention new games released, and then throwing in a "See OP" in the title as well?

    That'll be more likely to draw attention into the thread.

    gjaustin on
  • Options
    RainbowDespairRainbowDespair Registered User regular
    edited March 2010
    That's a good idea. It wouldn't be too hard to change the thread title every week or so to reflect good games that come out.

    RainbowDespair on
  • Options
    slash000slash000 Registered User regular
    edited March 2010
    Honestly not many people view this thread because they all think it's about nothing but programming.

    You peek in here and you quickly assume that this is the "XNA Development thread" rather than the Xbox Live Indie Games thread.

    slash000 on
  • Options
    fragglefartfragglefart Registered User regular
    edited March 2010
    I check it all the time to see what is coming out, or people are working on, but yeah, programming talk is scary.

    fragglefart on
    fragglefart.jpg
  • Options
    ZephosZephos Climbin in yo ski lifts, snatchin your people up. MichiganRegistered User regular
    edited March 2010
    programming talk makes me sleepy, but i do check this thread quite often to see what you guys are cooking up!

    Zephos on
    Xbox One/360: Penguin McCool
  • Options
    tastydonutstastydonuts Registered User regular
    edited March 2010
    hey all,

    our new game STICK 'EM UP is online on marketplace today!
    it's a 1-4 player co-op/vs stickman extravaganza. vehicles, explosions, awesomes, etc...

    xboxboxart.jpg
    http://download.xbox.com/content/xna/assets/58550485_World/screen2_Web.jpg
    http://download.xbox.com/content/xna/assets/58550485_World/screen3_Web.jpg

    marketplace link (download game/trial to X360)

    hope you guys like it.

    Curious, were those done via vectors?

    tastydonuts on
    “I used to draw, hard to admit that I used to draw...”
  • Options
    DelzhandDelzhand Hard to miss. Registered User regular
    edited March 2010
    Wow, the code here, copied and pasted, freezes my xbox.

    http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series1/Terrain_lighting.php

    Delzhand on
  • Options
    RiemannLivesRiemannLives Registered User regular
    edited March 2010
    Programming related, how do you guys manage a "loading screen" in your XNA apps?

    I am guessing it goes something like:

    1) Use ContentManager to load assets needed for loading screen
    2) Show loading screen
    3) Load other game assets
    4) Go to "press start to begin" state

    now with regards to 3 I have seen some conflicting reports as to how to manage this. My first inclination from app dev would be to spin off a thread (possibly out of a thread pool) and sequentially load assets on that thread.

    However, it seems that ContentManger might have some dependencies on the main thread for loading Texture2Ds.

    So, any advice for creating a Loading screen?

    RiemannLives on
    Attacked by tweeeeeeees!
  • Options
    DelzhandDelzhand Hard to miss. Registered User regular
    edited March 2010
    The GameStateManagement sample from the Creator's Club site is very literally the foundation on which I start all my games. It comes with a ScreenManager class that acts as a stack of screen classes, one of which is a loading screen.

    Even if you don't use it, you can look at the code to see how it works.

    ----

    Separate issue: I'm about to go over this with a fine toothed comb, but maybe another pair of eyes will help. Does anyone see anything in this code that would repeatedly cause it to freeze my Xbox but run fine on PC?
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    
    namespace _3DBattlefield
    {
        public class Game1 : Microsoft.Xna.Framework.Game
        {
            public struct VertexPositionNormalColored
            {
                public Vector3 Position;
                public Color Color;
                public Vector3 Normal;
    
                public static int SizeInBytes = 7 * 4;
                public static VertexElement[] VertexElements = new VertexElement[]
                {
                    new VertexElement( 0, 0, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Position, 0 ),
                    new VertexElement( 0, sizeof(float) * 3, VertexElementFormat.Color, VertexElementMethod.Default, VertexElementUsage.Color, 0 ),
                    new VertexElement( 0, sizeof(float) * 4, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Normal, 0 ),
                };
            }
    
    
            GraphicsDeviceManager graphics;
            SpriteBatch spriteBatch;
            Effect effect;
            VertexPositionNormalColored[] vertices;
            VertexDeclaration myVertexDeclaration;
            int[] indices;
            private int terrainWidth = 4;
            private int terrainHeight = 3;
            private float[,] heightData;
    
            public Game1()
            {
                graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";
    
                graphics.PreferredBackBufferWidth = 1280;
                graphics.PreferredBackBufferHeight = 720;
                graphics.IsFullScreen = false;
                graphics.ApplyChanges();
                Window.Title = "3D Battlefield";
    
            }
    
            protected override void Initialize()
            {
                base.Initialize();
            }
    
            protected override void LoadContent()
            {
                spriteBatch = new SpriteBatch(GraphicsDevice);
                effect = Content.Load<Effect>("effects");
    
                Texture2D heightMap = Content.Load<Texture2D>("heightmap");
                LoadHeightData(heightMap);
                SetUpVertices();
                SetUpIndices();
                CalculateNormals();
            }
    
            protected override void Update(GameTime gameTime)
            {
                if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                    this.Exit();
                base.Update(gameTime);
            }
    
            protected override void Draw(GameTime gameTime)
            {
                Matrix viewMatrix = Matrix.CreateLookAt(new Vector3(0, 100, 100), new Vector3(25, 25, 0), new Vector3(0, 1, 0));
                Matrix projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, GraphicsDevice.Viewport.AspectRatio, 1, 300);
                GraphicsDevice.Clear(Color.SlateBlue);
                GraphicsDevice.RenderState.CullMode = CullMode.None;
    
                effect.CurrentTechnique = effect.Techniques["Colored"];
                effect.Begin();
                effect.Parameters["xView"].SetValue(viewMatrix);
                effect.Parameters["xProjection"].SetValue(projectionMatrix);
                effect.Parameters["xWorld"].SetValue(Matrix.Identity);
    
                Vector3 lightDirection = new Vector3(8, 4.5f, 5);
                lightDirection.Normalize();
                effect.Parameters["xLightDirection"].SetValue(lightDirection);
                effect.Parameters["xAmbient"].SetValue(.1f);
                effect.Parameters["xEnableLighting"].SetValue(true);
    
                foreach (EffectPass pass in effect.CurrentTechnique.Passes)
                {
                    pass.Begin();
                    GraphicsDevice.VertexDeclaration = myVertexDeclaration;
                    GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length, indices, 0, indices.Length / 3);
                    pass.End();
                }
    
                spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.SaveState);
                spriteBatch.End();
    
                effect.End();
            }
    
            private void CalculateNormals()
            {
                for (int i = 0; i < vertices.Length; i++)
                    vertices[i].Normal = new Vector3(0, 0, 0);
    
                for (int i = 0; i < indices.Length / 3; i++)
                {
                    int index1 = indices[i * 3];
                    int index2 = indices[i * 3 + 1];
                    int index3 = indices[i * 3 + 2];
    
                    Vector3 side1 = vertices[index1].Position - vertices[index3].Position;
                    Vector3 side2 = vertices[index1].Position - vertices[index2].Position;
                    Vector3 normal = Vector3.Cross(side1, side2);
    
                    vertices[index1].Normal += normal;
                    vertices[index2].Normal += normal;
                    vertices[index3].Normal += normal;
                }
    
                for (int i = 0; i < vertices.Length; i++)
                    vertices[i].Normal.Normalize();
    
            }
    
            private void SetUpVertices()
            {
                float minHeight = float.MaxValue;
                float maxHeight = float.MinValue;
                for (int x = 0; x < terrainWidth; x++)
                {
                    for (int y = 0; y < terrainHeight; y++)
                    {
                        if (heightData[x, y] < minHeight)
                            minHeight = heightData[x, y];
                        if (heightData[x, y] > maxHeight)
                            maxHeight = heightData[x, y];
                    }
                }
    
                vertices = new VertexPositionNormalColored[terrainWidth * terrainHeight];
                for (int x = 0; x < terrainWidth; x++)
                {
                    for (int y = 0; y < terrainHeight; y++)
                    {
                        vertices[x + y * terrainWidth].Position = new Vector3(x, heightData[x, y], -y);
                        vertices[x + y * terrainWidth].Color = Color.Blue;
                    }
                }
    
                myVertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionNormalColored.VertexElements);
            }
    
            private void SetUpIndices()
            {
                indices = new int[(terrainWidth - 1) * (terrainHeight - 1) * 6];
                int counter = 0;
                for (int y = 0; y < terrainHeight - 1; y++)
                {
                    for (int x = 0; x < terrainWidth - 1; x++)
                    {
                        int lowerLeft = x + y * terrainWidth;
                        int lowerRight = (x + 1) + y * terrainWidth;
                        int topLeft = x + (y + 1) * terrainWidth;
                        int topRight = (x + 1) + (y + 1) * terrainWidth;
    
                        indices[counter++] = topLeft;
                        indices[counter++] = lowerRight;
                        indices[counter++] = lowerLeft;
    
                        indices[counter++] = topLeft;
                        indices[counter++] = topRight;
                        indices[counter++] = lowerRight;
                    }
                }
            }
    
            private void LoadHeightData()
            {
                heightData = new float[4, 3];
                heightData[0, 0] = 0;
                heightData[1, 0] = 0;
                heightData[2, 0] = 0;
                heightData[3, 0] = 0;
    
                heightData[0, 1] = 0.5f;
                heightData[1, 1] = 0;
                heightData[2, 1] = 0.1f;
                heightData[3, 1] = 0.2f;
    
                heightData[0, 2] = 1.0f;
                heightData[1, 2] = 1.2f;
                heightData[2, 2] = 0.8f;
                heightData[3, 2] = 0;
            }
    
            private void LoadHeightData(Texture2D heightMap)
            {
                terrainWidth = heightMap.Width;
                terrainHeight = heightMap.Height;
    
                Color[] heightMapColors = new Color[terrainWidth * terrainHeight];
                heightMap.GetData(heightMapColors);
    
                heightData = new float[terrainWidth, terrainHeight];
                for (int x = 0; x < terrainWidth; x++)
                    for (int y = 0; y < terrainHeight; y++)
                        heightData[x, y] = heightMapColors[x + y * terrainWidth].R / 5.0f;
            }
    
        }
    }
    

    Delzhand on
  • Options
    RiemannLivesRiemannLives Registered User regular
    edited March 2010
    Hey all, I was going to start tinkering with an XNA project this weekend (which will probably get shelved like all the others when work gets busy again) and am thinking about where to obtain a bunch of 2d artwork. Yes, I know the short answer is "give lots of cash money to an artist". However, the kind of stuff I need is very generic (details below). Do any of you know of any free-for-commercial-use or reasonably priced libraries of artwork (Artwork has value and I am fine with paying for it, but obviously do not want to spend more than $100 here) with stuff along the following lines:

    1) Icons for real-world commodities in the style of Civilization, Railroad Tycoon, The Settlers or older Microprose strategy titles like Master of Orion 2, Master of Magic etc... EG: Icons representing "resources" in a strategy game like timber, lumber, iron, steel, wheat, bread, corn. Also for people like laborers or nobles. Think the kind of stuff you see on the City Management screen in a Civilization game. Medieval or Renaissance in technology level.

    2) Artwork for map tiles. Forest, river, rocky ground, fertile ground, cultivated fields and such. Also some tiles representing houses of various levels of affluence (from small huts up to lavish mansions) would be nice.

    So, anyone have any leads on that kind of thing?

    http://opengameart.org/

    While I really appreciate the link, after looking through the details for some of the art on that site I would very very very strongly recommend that no one use anything whatsoever from that site unless they are a copyright lawyer with a lot of time on their hands.

    God damn, some of those descriptions just make my brain explode thinking about how crazy their license situation is. Stuff like "this art started in a copyrighted commercial game that was modified by person X as part of a mod for that game and later further modified by person Y as a mod for a different commercial game entirely".


    Ugh, just... no. No offense to you Archsorcerer but that place should never even be looked at by someone working on a commercial game.

    RiemannLives on
    Attacked by tweeeeeeees!
  • Options
    floatstarpxfloatstarpx Registered User regular
    edited March 2010
    hey all,

    our new game STICK 'EM UP is online on marketplace today!
    it's a 1-4 player co-op/vs stickman extravaganza. vehicles, explosions, awesomes, etc...

    xboxboxart.jpg
    http://download.xbox.com/content/xna/assets/58550485_World/screen2_Web.jpg
    http://download.xbox.com/content/xna/assets/58550485_World/screen3_Web.jpg

    marketplace link (download game/trial to X360)

    hope you guys like it.

    Curious, were those done via vectors?

    Yup, it's all vector based graphics/keyframed animation - so we get nice smooth animation as the players run / jump / rotate their guns etc... No 'sprites' used in game :)

    (edit: makes more sense if you watch in video, you can see how all graphics are vector based more clearly in motion)
    http://www.youtube.com/profile?user=WHATEVERgames#p/u/0/_K7oAmImVmo

    floatstarpx on
    Stick Unleashed - sticktacular stick battles, with vehicles, spaceships, wall-jump madness, multiple weapons and a built in level editor!! (co-op/vs 1-4 player X360)
    Also - I <3 Excruciating Guitar Voyage.
  • Options
    TubeTube Registered User admin
    edited March 2010
    Man I am straight up playing the shit out of this. I haven't killed this many stick men since -JOKE REDACTED BY ORDER OF PENNY ARCADE INC.-

    Tube on
  • Options
    AlejandroDaJAlejandroDaJ Registered User regular
    edited March 2010
    So, to access all the features needed for saving and loading, you have to add a GamerServicesComponent class to your project. Fair nuff, but I'm wondering why my fairly modest game now takes 5x longer to load in C#.

    A few nights ago, I accidentally hit the Guide button on my plugged in Xbox controller and got the whole Games For Windows Live spiel. First time I ever encountered it! I had to laugh about the relative amount of sense it makes to bundle that directly into the XNA framework for PC gaming. Not bad! Just wish it would load faster.

    AlejandroDaJ on
  • Options
    tastydonutstastydonuts Registered User regular
    edited March 2010
    hey all,

    our new game STICK 'EM UP is online on marketplace today!
    it's a 1-4 player co-op/vs stickman extravaganza. vehicles, explosions, awesomes, etc...

    xboxboxart.jpg
    http://download.xbox.com/content/xna/assets/58550485_World/screen2_Web.jpg
    http://download.xbox.com/content/xna/assets/58550485_World/screen3_Web.jpg

    marketplace link (download game/trial to X360)

    hope you guys like it.

    Curious, were those done via vectors?

    Yup, it's all vector based graphics/keyframed animation - so we get nice smooth animation as the players run / jump / rotate their guns etc... No 'sprites' used in game :)

    (edit: makes more sense if you watch in video, you can see how all graphics are vector based more clearly in motion)
    http://www.youtube.com/profile?user=WHATEVERgames#p/u/0/_K7oAmImVmo

    aye, seeing that brought back memories! hehe. cool game!

    tastydonuts on
    “I used to draw, hard to admit that I used to draw...”
  • Options
    savooipeerdsavooipeerd Registered User regular
    edited March 2010
    Delzhand wrote: »
    Separate issue: I'm about to go over this with a fine toothed comb, but maybe another pair of eyes will help. Does anyone see anything in this code that would repeatedly cause it to freeze my Xbox but run fine on PC?
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    
    namespace _3DBattlefield
    {
        public class Game1 : Microsoft.Xna.Framework.Game
        {
            public struct VertexPositionNormalColored
            {
                public Vector3 Position;
                public Color Color;
                public Vector3 Normal;
    
                public static int SizeInBytes = 7 * 4;
                public static VertexElement[] VertexElements = new VertexElement[]
                {
                    new VertexElement( 0, 0, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Position, 0 ),
                    new VertexElement( 0, sizeof(float) * 3, VertexElementFormat.Color, VertexElementMethod.Default, VertexElementUsage.Color, 0 ),
                    new VertexElement( 0, sizeof(float) * 4, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Normal, 0 ),
                };
            }
    
    
            GraphicsDeviceManager graphics;
            SpriteBatch spriteBatch;
            Effect effect;
            VertexPositionNormalColored[] vertices;
            VertexDeclaration myVertexDeclaration;
            int[] indices;
            private int terrainWidth = 4;
            private int terrainHeight = 3;
            private float[,] heightData;
    
            public Game1()
            {
                graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";
    
                graphics.PreferredBackBufferWidth = 1280;
                graphics.PreferredBackBufferHeight = 720;
                graphics.IsFullScreen = false;
                graphics.ApplyChanges();
                Window.Title = "3D Battlefield";
    
            }
    
            protected override void Initialize()
            {
                base.Initialize();
            }
    
            protected override void LoadContent()
            {
                spriteBatch = new SpriteBatch(GraphicsDevice);
                effect = Content.Load<Effect>("effects");
    
                Texture2D heightMap = Content.Load<Texture2D>("heightmap");
                LoadHeightData(heightMap);
                SetUpVertices();
                SetUpIndices();
                CalculateNormals();
            }
    
            protected override void Update(GameTime gameTime)
            {
                if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                    this.Exit();
                base.Update(gameTime);
            }
    
            protected override void Draw(GameTime gameTime)
            {
                Matrix viewMatrix = Matrix.CreateLookAt(new Vector3(0, 100, 100), new Vector3(25, 25, 0), new Vector3(0, 1, 0));
                Matrix projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, GraphicsDevice.Viewport.AspectRatio, 1, 300);
                GraphicsDevice.Clear(Color.SlateBlue);
                GraphicsDevice.RenderState.CullMode = CullMode.None;
    
                effect.CurrentTechnique = effect.Techniques["Colored"];
                effect.Begin();
                effect.Parameters["xView"].SetValue(viewMatrix);
                effect.Parameters["xProjection"].SetValue(projectionMatrix);
                effect.Parameters["xWorld"].SetValue(Matrix.Identity);
    
                Vector3 lightDirection = new Vector3(8, 4.5f, 5);
                lightDirection.Normalize();
                effect.Parameters["xLightDirection"].SetValue(lightDirection);
                effect.Parameters["xAmbient"].SetValue(.1f);
                effect.Parameters["xEnableLighting"].SetValue(true);
    
                foreach (EffectPass pass in effect.CurrentTechnique.Passes)
                {
                    pass.Begin();
                    GraphicsDevice.VertexDeclaration = myVertexDeclaration;
                    GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length, indices, 0, indices.Length / 3);
                    pass.End();
                }
    
                spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.SaveState);
                spriteBatch.End();
    
                effect.End();
            }
    
            private void CalculateNormals()
            {
                for (int i = 0; i < vertices.Length; i++)
                    vertices[i].Normal = new Vector3(0, 0, 0);
    
                for (int i = 0; i < indices.Length / 3; i++)
                {
                    int index1 = indices[i * 3];
                    int index2 = indices[i * 3 + 1];
                    int index3 = indices[i * 3 + 2];
    
                    Vector3 side1 = vertices[index1].Position - vertices[index3].Position;
                    Vector3 side2 = vertices[index1].Position - vertices[index2].Position;
                    Vector3 normal = Vector3.Cross(side1, side2);
    
                    vertices[index1].Normal += normal;
                    vertices[index2].Normal += normal;
                    vertices[index3].Normal += normal;
                }
    
                for (int i = 0; i < vertices.Length; i++)
                    vertices[i].Normal.Normalize();
    
            }
    
            private void SetUpVertices()
            {
                float minHeight = float.MaxValue;
                float maxHeight = float.MinValue;
                for (int x = 0; x < terrainWidth; x++)
                {
                    for (int y = 0; y < terrainHeight; y++)
                    {
                        if (heightData[x, y] < minHeight)
                            minHeight = heightData[x, y];
                        if (heightData[x, y] > maxHeight)
                            maxHeight = heightData[x, y];
                    }
                }
    
                vertices = new VertexPositionNormalColored[terrainWidth * terrainHeight];
                for (int x = 0; x < terrainWidth; x++)
                {
                    for (int y = 0; y < terrainHeight; y++)
                    {
                        vertices[x + y * terrainWidth].Position = new Vector3(x, heightData[x, y], -y);
                        vertices[x + y * terrainWidth].Color = Color.Blue;
                    }
                }
    
                myVertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionNormalColored.VertexElements);
            }
    
            private void SetUpIndices()
            {
                indices = new int[(terrainWidth - 1) * (terrainHeight - 1) * 6];
                int counter = 0;
                for (int y = 0; y < terrainHeight - 1; y++)
                {
                    for (int x = 0; x < terrainWidth - 1; x++)
                    {
                        int lowerLeft = x + y * terrainWidth;
                        int lowerRight = (x + 1) + y * terrainWidth;
                        int topLeft = x + (y + 1) * terrainWidth;
                        int topRight = (x + 1) + (y + 1) * terrainWidth;
    
                        indices[counter++] = topLeft;
                        indices[counter++] = lowerRight;
                        indices[counter++] = lowerLeft;
    
                        indices[counter++] = topLeft;
                        indices[counter++] = topRight;
                        indices[counter++] = lowerRight;
                    }
                }
            }
    
            private void LoadHeightData()
            {
                heightData = new float[4, 3];
                heightData[0, 0] = 0;
                heightData[1, 0] = 0;
                heightData[2, 0] = 0;
                heightData[3, 0] = 0;
    
                heightData[0, 1] = 0.5f;
                heightData[1, 1] = 0;
                heightData[2, 1] = 0.1f;
                heightData[3, 1] = 0.2f;
    
                heightData[0, 2] = 1.0f;
                heightData[1, 2] = 1.2f;
                heightData[2, 2] = 0.8f;
                heightData[3, 2] = 0;
            }
    
            private void LoadHeightData(Texture2D heightMap)
            {
                terrainWidth = heightMap.Width;
                terrainHeight = heightMap.Height;
    
                Color[] heightMapColors = new Color[terrainWidth * terrainHeight];
                heightMap.GetData(heightMapColors);
    
                heightData = new float[terrainWidth, terrainHeight];
                for (int x = 0; x < terrainWidth; x++)
                    for (int y = 0; y < terrainHeight; y++)
                        heightData[x, y] = heightMapColors[x + y * terrainWidth].R / 5.0f;
            }
    
        }
    }
    

    Although it often seems to work fine, I don't think you are supposed to change the vertex declaration between effect.Begin() and effect.End(). You seem to be setting the same vertex declaration inside every effect pass, which would at the very least be redundant.

    savooipeerd on
    [SIGPIC][/SIGPIC]
  • Options
    AlejandroDaJAlejandroDaJ Registered User regular
    edited March 2010
    Does anyone have any idea on the economics behind game pricing? Like, if you make the game too expensive and sell for 240 MS funbucks instead of 80 and sales stagnate, can you juice sales by dropping the price? Or do potential buyers tend to skip over it?

    AlejandroDaJ on
  • Options
    RainbowDespairRainbowDespair Registered User regular
    edited March 2010
    Does anyone have any idea on the economics behind game pricing? Like, if you make the game too expensive and sell for 240 MS funbucks instead of 80 and sales stagnate, can you juice sales by dropping the price? Or do potential buyers tend to skip over it?

    Generally dropping the price helps somewhat, but you still have the problem of letting people know that it's at a lowered price.

    RainbowDespair on
  • Options
    tastydonutstastydonuts Registered User regular
    edited March 2010
    Speccing out something and I forgot... what is bone count limit in XNA? I'm pretty sure it's per mesh, iirc... but the exact number escapes me atm.

    edit: looking around gives me 80, but the posts where this is stated (other places) are rather old.

    tastydonuts on
    “I used to draw, hard to admit that I used to draw...”
  • Options
    slash000slash000 Registered User regular
    edited March 2010
    Just finished making the last dungeon for Breath of Death. Still gotta add some things to some towns and polish some areas in terms of a few details but nevertheless it feels good that our game world is, essentially, all there.

    slash000 on
  • Options
    DelzhandDelzhand Hard to miss. Registered User regular
    edited March 2010
    IIRC the bone count limit can be gotten around by writing your own content importer and fx file.

    Delzhand on
  • Options
    tastydonutstastydonuts Registered User regular
    edited March 2010
    Delzhand wrote: »
    IIRC the bone count limit can be gotten around by writing your own content importer and fx file.

    That's the thing, I don't want to have to do that unless I absolutely have to. The situation that I'm in currently leaves me in a position where I can avoid that.

    I don't see having more than 80 bones per mesh (just using a simplified biped rig), but I can see there being a higher total of bones amongst all the models. worse come to worse I'll end up hacking something together, but I'd like to try and plan and avoid the inevitable.

    tastydonuts on
    “I used to draw, hard to admit that I used to draw...”
  • Options
    HandkorHandkor Registered User regular
    edited March 2010
    Delzhand wrote: »
    Separate issue: I'm about to go over this with a fine toothed comb, but maybe another pair of eyes will help. Does anyone see anything in this code that would repeatedly cause it to freeze my Xbox but run fine on PC?
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    
    namespace _3DBattlefield
    {
        public class Game1 : Microsoft.Xna.Framework.Game
        {
            public struct VertexPositionNormalColored
            {
                public Vector3 Position;
                public Color Color;
                public Vector3 Normal;
    
                public static int SizeInBytes = 7 * 4;
                public static VertexElement[] VertexElements = new VertexElement[]
                {
                    new VertexElement( 0, 0, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Position, 0 ),
                    new VertexElement( 0, sizeof(float) * 3, VertexElementFormat.Color, VertexElementMethod.Default, VertexElementUsage.Color, 0 ),
                    new VertexElement( 0, sizeof(float) * 4, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Normal, 0 ),
                };
            }
    
    
            GraphicsDeviceManager graphics;
            SpriteBatch spriteBatch;
            Effect effect;
            VertexPositionNormalColored[] vertices;
            VertexDeclaration myVertexDeclaration;
            int[] indices;
            private int terrainWidth = 4;
            private int terrainHeight = 3;
            private float[,] heightData;
    
            public Game1()
            {
                graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";
    
                graphics.PreferredBackBufferWidth = 1280;
                graphics.PreferredBackBufferHeight = 720;
                graphics.IsFullScreen = false;
                graphics.ApplyChanges();
                Window.Title = "3D Battlefield";
    
            }
    
            protected override void Initialize()
            {
                base.Initialize();
            }
    
            protected override void LoadContent()
            {
                spriteBatch = new SpriteBatch(GraphicsDevice);
                effect = Content.Load<Effect>("effects");
    
                Texture2D heightMap = Content.Load<Texture2D>("heightmap");
                LoadHeightData(heightMap);
                SetUpVertices();
                SetUpIndices();
                CalculateNormals();
            }
    
            protected override void Update(GameTime gameTime)
            {
                if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                    this.Exit();
                base.Update(gameTime);
            }
    
            protected override void Draw(GameTime gameTime)
            {
                Matrix viewMatrix = Matrix.CreateLookAt(new Vector3(0, 100, 100), new Vector3(25, 25, 0), new Vector3(0, 1, 0));
                Matrix projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, GraphicsDevice.Viewport.AspectRatio, 1, 300);
                GraphicsDevice.Clear(Color.SlateBlue);
                GraphicsDevice.RenderState.CullMode = CullMode.None;
    
                effect.CurrentTechnique = effect.Techniques["Colored"];
                effect.Begin();
                effect.Parameters["xView"].SetValue(viewMatrix);
                effect.Parameters["xProjection"].SetValue(projectionMatrix);
                effect.Parameters["xWorld"].SetValue(Matrix.Identity);
    
                Vector3 lightDirection = new Vector3(8, 4.5f, 5);
                lightDirection.Normalize();
                effect.Parameters["xLightDirection"].SetValue(lightDirection);
                effect.Parameters["xAmbient"].SetValue(.1f);
                effect.Parameters["xEnableLighting"].SetValue(true);
    
                foreach (EffectPass pass in effect.CurrentTechnique.Passes)
                {
                    pass.Begin();
                    GraphicsDevice.VertexDeclaration = myVertexDeclaration;
                    GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length, indices, 0, indices.Length / 3);
                    pass.End();
                }
    
                spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.SaveState);
                spriteBatch.End();
    
                effect.End();
            }
    
            private void CalculateNormals()
            {
                for (int i = 0; i < vertices.Length; i++)
                    vertices[i].Normal = new Vector3(0, 0, 0);
    
                for (int i = 0; i < indices.Length / 3; i++)
                {
                    int index1 = indices[i * 3];
                    int index2 = indices[i * 3 + 1];
                    int index3 = indices[i * 3 + 2];
    
                    Vector3 side1 = vertices[index1].Position - vertices[index3].Position;
                    Vector3 side2 = vertices[index1].Position - vertices[index2].Position;
                    Vector3 normal = Vector3.Cross(side1, side2);
    
                    vertices[index1].Normal += normal;
                    vertices[index2].Normal += normal;
                    vertices[index3].Normal += normal;
                }
    
                for (int i = 0; i < vertices.Length; i++)
                    vertices[i].Normal.Normalize();
    
            }
    
            private void SetUpVertices()
            {
                float minHeight = float.MaxValue;
                float maxHeight = float.MinValue;
                for (int x = 0; x < terrainWidth; x++)
                {
                    for (int y = 0; y < terrainHeight; y++)
                    {
                        if (heightData[x, y] < minHeight)
                            minHeight = heightData[x, y];
                        if (heightData[x, y] > maxHeight)
                            maxHeight = heightData[x, y];
                    }
                }
    
                vertices = new VertexPositionNormalColored[terrainWidth * terrainHeight];
                for (int x = 0; x < terrainWidth; x++)
                {
                    for (int y = 0; y < terrainHeight; y++)
                    {
                        vertices[x + y * terrainWidth].Position = new Vector3(x, heightData[x, y], -y);
                        vertices[x + y * terrainWidth].Color = Color.Blue;
                    }
                }
    
                myVertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionNormalColored.VertexElements);
            }
    
            private void SetUpIndices()
            {
                indices = new int[(terrainWidth - 1) * (terrainHeight - 1) * 6];
                int counter = 0;
                for (int y = 0; y < terrainHeight - 1; y++)
                {
                    for (int x = 0; x < terrainWidth - 1; x++)
                    {
                        int lowerLeft = x + y * terrainWidth;
                        int lowerRight = (x + 1) + y * terrainWidth;
                        int topLeft = x + (y + 1) * terrainWidth;
                        int topRight = (x + 1) + (y + 1) * terrainWidth;
    
                        indices[counter++] = topLeft;
                        indices[counter++] = lowerRight;
                        indices[counter++] = lowerLeft;
    
                        indices[counter++] = topLeft;
                        indices[counter++] = topRight;
                        indices[counter++] = lowerRight;
                    }
                }
            }
    
            private void LoadHeightData()
            {
                heightData = new float[4, 3];
                heightData[0, 0] = 0;
                heightData[1, 0] = 0;
                heightData[2, 0] = 0;
                heightData[3, 0] = 0;
    
                heightData[0, 1] = 0.5f;
                heightData[1, 1] = 0;
                heightData[2, 1] = 0.1f;
                heightData[3, 1] = 0.2f;
    
                heightData[0, 2] = 1.0f;
                heightData[1, 2] = 1.2f;
                heightData[2, 2] = 0.8f;
                heightData[3, 2] = 0;
            }
    
            private void LoadHeightData(Texture2D heightMap)
            {
                terrainWidth = heightMap.Width;
                terrainHeight = heightMap.Height;
    
                Color[] heightMapColors = new Color[terrainWidth * terrainHeight];
                heightMap.GetData(heightMapColors);
    
                heightData = new float[terrainWidth, terrainHeight];
                for (int x = 0; x < terrainWidth; x++)
                    for (int y = 0; y < terrainHeight; y++)
                        heightData[x, y] = heightMapColors[x + y * terrainWidth].R / 5.0f;
            }
    
        }
    }
    

    Although it often seems to work fine, I don't think you are supposed to change the vertex declaration between effect.Begin() and effect.End(). You seem to be setting the same vertex declaration inside every effect pass, which would at the very least be redundant.

    I've never got into any problems of setting the vertex declaration but this declaration on my 360 will take down my games but not on the PC.

    myVertexDeclaration = new VertexDeclaration(GraphicsDevice, VertexPositionNormalColored.VertexElements);

    I've changed all my code to initialize this once at load time and I even keep them as statics for my model types that have custom vertex declarations.

    Handkor on
  • Options
    StargliderStarglider Registered User regular
    edited March 2010
    Did you try padding the vertex structure to a multiple of 64 bits? I do that for all my vertices because I've had major problems trying to get unaligned vertices to work on the X360.

    Starglider on
  • Options
    DelzhandDelzhand Hard to miss. Registered User regular
    edited March 2010
    Someone on the XNA forums suggested that. I tried it, but I may have done it wrong. In any case, I'm not using that code exactly - I just came across a problem and my desire to solve it overtook my sense of whether or not it was worth my time.

    Delzhand on
This discussion has been closed.