Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kpulv

Pages: [1] 2
1
DotNet / Re: SFML.NET Proposed Changes
« on: May 08, 2014, 09:04:50 am »
Being able to modify Vertices in VertexArrays like you can in the C++ version would be awesome.  It's tough to make good performing custom graphic types that rely on vertex arrays since in C# you have to create all new vertices or rebuild the geometry from scratch whenever an update is needed.

2
SFML projects / Re: All the King's Men
« on: February 08, 2014, 06:56:43 am »
Ah, yeah I use a tile sheet full of images that are used to "paint" the ground along the path.  Making the background goes through passes like this:

1. Draw grass tiles randomly all over the entire map.
2. Draw dark green grass tiles along the path with a very wide spread.  Draw enough to completely cover the path.
3. Draw dark brown dirt tiles along the path with a slightly lower spread.  Draw enough to completely cover the path, but leave a little bit of dark green on the outside.
4. Draw the light brown dirt tiles along the path with a narrow spread.

3
SFML projects / Re: All the King's Men
« on: February 02, 2014, 06:17:51 am »
Thanks!

The map is generated using a list of 2d points.  I start by choosing a random point on the left side of the scene, and then start placing points outward from there.  I basically just keep track of an angle at which the road should be drawn in, and every time I place a point I adjust that angle by a random amount.  I have some safety checks in there, like the road can never go backwards, and the road is too far up or too far down it forces the angle back on track.  When I get a certain distance from the start I stop generating points, and that's the end of the level.

For the decorations and stuff, I just populate the entire map with trees and then remove trees that are a certain distance from each node on the path.  Enemies are then placed randomly in trees near the road, and soldiers are placed along the road every couple of nodes or so.

Does that make sense?

4
SFML projects / Re: All the King's Men
« on: November 18, 2013, 08:50:07 pm »
Hey thanks for the feedback!  I'm going to make some slight adjustments to the camera and try to put in a way to skip the intro for version 1.1 this week :)

5
SFML projects / Re: All the King's Men
« on: November 15, 2013, 09:45:20 pm »
I slept on the first night from 4am to 11am, there's a big jump in time in the time lapse around then.  I didn't sleep for the rest of the time.

6
SFML projects / Re: All the King's Men
« on: November 15, 2013, 05:11:38 am »
Thanks!  RIP in peace is intentional, haha ;D

I posted the time lapse of the 48 hour jam if you want to check out 48 hours of work compressed into 4 minutes:

7
SFML projects / Re: All the King's Men
« on: November 14, 2013, 12:42:19 am »
Hm, interesting!  For some reason it's chugging on the level generation for you then.  What're the specs on the computer you're running it on?

8
SFML projects / Re: All the King's Men
« on: November 13, 2013, 11:38:10 pm »
Well that stinks, what are your system specs?  Sounds likes crashing during the level generation for some reason.

You could try this:
At the title screen hit ~ to open the console and type graphicdetail 0 and push enter.  Hit ~ again to close the console, then try to play the game and see if it still crashes.

9
SFML projects / Re: All the King's Men
« on: November 13, 2013, 11:01:53 pm »
Not had a chance to play yet (I'm at work) - but the graphics look really nice. I also like the artwork on your site, is it all your own?

Hey thanks! Yeah, that's all my doing.

Really fun game!
 
Nicely done, love all those "small" effects. e.g. Music effects, text effects...

The tresures are too juicy, can't resist the bait  ;D


AlexAUT

Thanks!

<3

10
SFML projects / Re: All the King's Men
« on: November 13, 2013, 04:32:09 pm »
Haha the treasure is indeed tempting ;D  I could add maybe hearts in some treasure chests that could heal the King by 1 HP.

Thanks for the feedback!

11
SFML projects / Re: Any .NET open source game written in SFML.NET?
« on: November 13, 2013, 04:08:59 am »
Hi!  I actually have an open source dotnet framework using SFML as the underbelly.  You can check it out at http://otter2d.com :)

edit: Oh whoops you're looking for a game sorry!  I'll be open sourcing a game soon though!

12
SFML projects / All the King's Men
« on: November 13, 2013, 01:20:17 am »
Hey!  I've been using SFML dotnet for a few months now building a little framework thing (http://otter2d.com) and this past weekend I did a game jam to test it out, and it turned out pretty well!

All the King's Men
Download for Windows: http://kpulv.com/downloads/KingsMenWindows.zip
My blog post where you can find more info: http://kpulv.com/210/All_the_King_s_Men/

The idea of the game is that you're trying to protect the King using the guards that are stationed on the path.  I recommend using an xbox360 controller or a similar PC controller, but keyboard works too.

The guards can also go out and find treasure boxes full of amazing loot and bring it back to the King, and if the King does make it to the end of his journey then you'll be scored based off how much treasure the King ended up with.

Here's some screenshots:







Thanks for checking it out! ;D

13
DotNet / Re: Can't modify vertex in vertexarray
« on: November 06, 2013, 05:16:10 am »
Hm, bummer.  If there's so much dislike of structs when it comes to this kind of stuff, why did SFML end up using them in so many places for the dotnet version?

14
DotNet / Can't modify vertex in vertexarray
« on: November 06, 2013, 01:20:58 am »
I've been working on trying to get batched rendering working for my framework using SFML, but it seems that in dotnet I am unable to edit a vertex after it's in the array.  I'm attempting to draw a large number of sprites that are dynamic with the vertex array, and rebuilding the array during each update to take into account the changes ends up being very costly (5000 quads is when my update loop takes more than 17ms meaning the framerate is no longer a smooth 60)

Is there something I'm missing on how I should be trying to organize this logic?  If I cant modify the vertex after it's in the vertex array, what is the best option for updating the vertices aside from rebuilding the entire array each time?

15
Graphics / SFML Text Origin Y Question
« on: September 23, 2013, 02:05:56 am »
Hello!  I was wondering if this was the intended behavior of the text class when adjusting the Y origin for purposes of scaling and rotating:



Usually for images adjusting the Y origin to half the height of the image will guarantee the perfect center of the image, but for text this doesn't seem to be the case.  In the image above, I'm rendering a red pixel at the X and Y coordinate of the text to show how centered it is.

The first text at the top uses GetLocalBounds().Height * 0.5f.  It doesn't look vertically centered though when scaling.  The second text uses the same thing except 0.75f instead of 0.5f, and ends up looking more vertically centered than the 0.5f one. The third uses 0 just as a reference.

Here's all the code I used to make this example (SFML 2.1 in C#):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFML.Graphics;
using SFML.Window;

namespace SFMLTextTest {
    class Program {
        static void Main(string[] args) {
            RenderWindow window = new RenderWindow(new VideoMode(1000, 750), "Test Application");

            Font font = new Font("arial.ttf");
            string testString = "Testing Font yGpQ`";

            Text text = new Text(testString, font);
            text.Origin = new Vector2f(text.GetLocalBounds().Width / 2f, text.GetLocalBounds().Height / 2f);
            text.Position = new Vector2f(window.Size.X / 2f, window.Size.Y * 0.25f);

            text.Color = Color.Yellow;

            CircleShape textCircle = new CircleShape(1f);
            textCircle.Position = text.Position;
            textCircle.FillColor = Color.Red;

            Text text2 = new Text(testString, font);
            text2.Origin = new Vector2f(text2.GetLocalBounds().Width / 2f, text2.GetLocalBounds().Height * .75f);
            text2.Position = new Vector2f(window.Size.X / 2f, window.Size.Y * 0.5f);

            text2.Color = Color.Cyan;

            CircleShape text2Circle = new CircleShape(1f);
            text2Circle.Position = text2.Position;
            text2Circle.FillColor = Color.Red;

            Text text3 = new Text(testString, font);
            text3.Origin = new Vector2f(text2.GetLocalBounds().Width / 2f, 0);
            text3.Position = new Vector2f(window.Size.X / 2f, window.Size.Y * 0.75f);

            text3.Color = Color.Green;

            CircleShape text3Circle = new CircleShape(1f);
            text3Circle.Position = text3.Position;
            text3Circle.FillColor = Color.Red;

            window.Closed += new EventHandler(OnClosed);

            float timePassed = 0;

            float scaleText = 1f;

            while (window.IsOpen()) {
                window.DispatchEvents();

                window.Clear();

                scaleText = (float)(((Math.Sin(timePassed * 0.025f) + 1f) / 2f) * 2.5f);

                text.Scale = text2.Scale = text3.Scale = new Vector2f(scaleText, scaleText);
                timePassed += 0.1f;

                window.Draw(text);
                window.Draw(text2);
                window.Draw(text3);

                window.Draw(textCircle);
                window.Draw(text2Circle);
                window.Draw(text3Circle);

                window.Display();

            }
        }

        static void OnClosed(object sender, EventArgs e) {
            Window window = (Window)sender;
            window.Close();
        }
    }
}
 

Here's another screenshot using characters that display better the bounds of possible characters:



Even here, using Origin Y as half the height seems misaligned.

Pages: [1] 2