Adam's Lair Forum

game development and casual madness
It is currently 2017/04/25, 08:29

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: 2015/01/16, 21:42 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1948
Location: Germany
Role: Professional
The new background is awesome! Not because of the actual background texture (can't see it very well in this video here), but because the parallax effect immediately gives you a great sense of depth as soon as you're zooming or scrolling. Immediate "Whoa"-feeling when watching the video.

The UI looks nice, too. Maybe some color highlights or black outlines to give it a little more contrast?

Also, nice fade-in after the loading. I like the minimal approach here. Maybe some randomized text would be a good addition though, so you have something to do while waiting.

By the way, how did you do the loading screen animation? Do you preload Resources to memory in a separate Thread?

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/01/17, 08:46 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 821
Location: Italy
Role: Hobbyist
Adam wrote:
The new background is awesome! Not because of the actual background texture (can't see it very well in this video here), but because the parallax effect immediately gives you a great sense of depth as soon as you're zooming or scrolling. Immediate "Whoa"-feeling when watching the video.

Thanks :mrgreen:

Adam wrote:
The UI looks nice, too. Maybe some color highlights or black outlines to give it a little more contrast?

Ah yes, as I said the control UI is still unfinished (as you can notice by the huge empty white space in the bottom). Now I have to add all the buttons and whatnot around.

Adam wrote:
Also, nice fade-in after the loading. I like the minimal approach here. Maybe some randomized text would be a good addition though, so you have something to do while waiting.

I agree.. for now I still have a lot to do on the basic gameplay side so graphical niceties will have to wait until a little later :)

Adam wrote:
By the way, how did you do the loading screen animation? Do you preload Resources to memory in a separate Thread?

Yep. The Loading scene contains a Component that basically starts a Thread and in the OnUpdate method checks if it finished doing its job or not.

The Thread itself generates the map data structure, some Pixmaps and preloads them (I tried to make it preload the Materials as well but since Textures cannot be prepared in a thread other than the Main one, I decided to stop at the Pixmaps); at the end, it builds the Game Scene and switches to it :)

If anyone's interested, this is how I did it
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Duality;
using Duality.Components;
using System.Threading;
using Duality.Resources;
using BrokenGalaxy.Entities;
using OpenTK;
using Duality.Components.Renderers;
using SnowyPeak.Duality.Plugin.Frozen.Procedural;
using SnowyPeak.Duality.Plugin.Frozen.Core.Geometry;
using SnowyPeak.Duality.Plugin.Frozen.Core;

namespace BrokenGalaxy.Components
{
   [Serializable]
   public class MapLoader : Component, ICmpUpdatable
   {
      [NonSerialized]
      private Thread _loadingThread;

      [NonSerialized]
      private AnimSpriteRenderer _spinner;

      void ICmpUpdatable.OnUpdate()
      {
         if (GameData.Instance.GameMap.CurrentGenerationStep == Data.GenerationStep.Finished)
         {
            // Map is ready.. Build the scene
            BuildGameScene();
            _loadingThread = null;
         }
         else
         {
            // Map is not ready? Do I have to start the generation?
            if (_loadingThread == null || !_loadingThread.IsAlive)
            {
               _loadingThread = new Thread(new ThreadStart(Loader));
               _loadingThread.IsBackground = true;

               _loadingThread.Start();
            }
         }

         if (_spinner == null)
         {
            _spinner = this.GameObj.ParentScene.FindGameObject("Spinner").GetComponent<AnimSpriteRenderer>();
         }
         if (_spinner != null)
         {
            _spinner.GameObj.Transform.Pos = this.GameObj.Camera.GetSpaceCoord(DualityApp.TargetResolution - _spinner.Rect.Size / 2);
            _spinner.GameObj.Transform.TurnBy(MathF.Pi * Time.LastDelta / 1000f);
         }
      }

      private void Loader()
      {
         Generators.GeneratedPixmaps.Instance.GetPixmap("Nebula1");
         Generators.GeneratedPixmaps.Instance.GetPixmap("Starfield1");
         Generators.GeneratedPixmaps.Instance.GetPixmap("Dark1");

         GameData.Instance.GameMap.GenerateMap();
      }

      private void BuildGameScene()
      {
         GameMap map = GameData.Instance.GameMap;
         MapParameters mPars = GameData.Instance.MapParameters;

         GameData.Instance.MapLimits = new Vector2(mPars.Width - 1, mPars.Height - 1) * GameData.MAP_SCALE;

         map.MarkAsLoaded();

         Scene gameScene = GameRes.Data.Scenes.Game_Scene.Res;
         GameObject gameCamera = gameScene.FindGameObject("_Camera");

         // Removing all Root objects besides the Camera
         GameObject[] objectsToRemove = gameScene.RootObjects.Where(go => go != gameCamera).ToArray();

         foreach (GameObject go in objectsToRemove)
         {
            go.DisposeLater();
            gameScene.RemoveObject(go);
         }

         // Create the StarSystemWidgets
         foreach (StarSystem ss in map.Graph.Nodes)
         {
            GameObject system = GameRes.Data.Prefabs.StarSystem_Prefab.Res.Instantiate();
            system.BreakPrefabLink();
            gameScene.AddObject(system);

            system.Name = ss.Name;
            system.Transform.Pos = new Vector3(ss.Position.X, ss.Position.Y, 0) * GameData.MAP_SCALE;
            system.GetComponent<StarSystemWidget>().AssignSystem(ss);
         }

         // Create the Links
         foreach (Link<StarSystem> l in map.Graph.Links)
         {
            GameObject link = GameRes.Data.Prefabs.Link_Prefab.Res.Instantiate();
            link.BreakPrefabLink();

            Vector3 nodeFrom = new Vector3(l.From.Position.X, l.From.Position.Y, 0) * GameData.MAP_SCALE;
            Vector3 nodeTo = new Vector3(l.To.Position.X, l.To.Position.Y, 0) * GameData.MAP_SCALE;
            float dx = nodeTo.X - nodeFrom.X;
            float dy = nodeTo.Y - nodeFrom.Y;

            Vector3 position = (nodeTo + nodeFrom) / 2f;
            position.Z = .05f;
            link.Transform.Pos = position;
            link.Transform.Angle = MathF.Atan2(dy, dx);

            LinkRenderer renderer = link.GetComponent<LinkRenderer>();
            renderer.Rect = Rect.AlignCenter(0, 0, MathF.Sqrt(MathF.Pow(dx, 2) + MathF.Pow(dy, 2)) - GameData.SYSTEM_SIZE, 2);
            renderer.AssignLink(l);

            gameScene.AddObject(link);
         }

         // Setup players
         GameData.Instance.PreparePlayers(mPars.AIPlayers);
         foreach (Player ai in GameData.Instance.AIPlayers)
         {
            map.AddPlayer(ai);
         }
         map.AddPlayer(GameData.Instance.HumanPlayer);

         // Camera setup, Scene switch and fade in
         GameData.Instance.GameSpeed = GameSpeed.Pause;

         gameCamera.Camera.LookAt(new Polygon(new Rect(GameData.Instance.MapLimits).Expand(GameData.MAP_SCALE)), 0);
         gameScene.FindComponent<GameController>().ResetGame();

         Scene.SwitchTo(gameScene);
         gameCamera.Camera.Fade(2, Colors.Black, Colors.Transparent);
      }
   }
}


_________________
Come on Duality's Discord channel. It's entertaining and productive! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/03/02, 12:01 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1948
Location: Germany
Role: Professional
Just a quick note that I recently opened the Showcase thread - so in case you want to contribute some screenshots, go ahead ;)

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/03/14, 18:20 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 821
Location: Italy
Role: Hobbyist
Well, it has been long and difficult but finally I uploaded alpha 1 of Broken Galaxy! You can find the game and all the instructions here

I know there are some not-so-pretty graphical glitches here and there, such as the "loading" spinner that sometimes flashes a yellow line around it, but they are due to the fact that I packed my spritesheet too tightly and it's not that big a deal for an alpha so.. :mrgreen:

Well, that's all I have to say for now. Hope you'll enjoy!
Let the feedbacks rain :mrgreen:

_________________
Come on Duality's Discord channel. It's entertaining and productive! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/03/14, 21:59 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1948
Location: Germany
Role: Professional
Okay, so my first round looked like this:

Image

That AI somehow managed to win and I didn't have a chance at all. I restarted and it was all the same. (By the way, this game really needs a quick "Restart with a new level" button!)

And then I discovered I needed to colonize planets :D It got a lot easier after that. Still, it's definitely a fun little game and difficulty can always ramp up the difficulty by giving the AI a little starting advantage.

I really liked being able to "link" systems together, so they automatically send their forces along a certain path. This is so much better than having to micro-manage everything. However, I missed the option to send only a part of my ships to a different system in regular movement. Maybe you could allow to CTRL + Click in order to send only half the ships, while keeping the action, so you can CTRL + Click + Click to send 3 / 4 of ships and so on?

One thing that feels a little weird is moving the map - it's all "floaty" and smooth, but I think a rather "hard", direct movement would be a little better here.

What I didn't get was: Does it make a difference at all what kind of planet you colonize? I figured out to leave out the volcanic and glacier ones, but then it occurred to me that they really spawn a lot of ships as well. So.. just colonize all the planets? :D

Looking forward to future versions ^^

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/03/14, 22:37 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 821
Location: Italy
Role: Hobbyist
Adam wrote:
And then I discovered I needed to colonize planets :D It got a lot easier after that.
...

What I didn't get was: Does it make a difference at all what kind of planet you colonize? I figured out to leave out the volcanic and glacier ones, but then it occurred to me that they really spawn a lot of ships as well. So.. just colonize all the planets? :D

Weeeeell, if you read the whole link you would know all about that :mrgreen: so yes, you need to colonize and yes, planets matter (not too much for now, but it does)

Adam wrote:
(By the way, this game really needs a quick "Restart with a new level" button!)
...
I really liked being able to "link" systems together, so they automatically send their forces along a certain path. This is so much better than having to micro-manage everything. However, I missed the option to send only a part of my ships to a different system in regular movement. Maybe you could allow to CTRL + Click in order to send only half the ships, while keeping the action, so you can CTRL + Click + Click to send 3 / 4 of ships and so on?

Yes, this is on the list of things to do (stuff like "send when you have more than..." or "keep ... ships at all times").. next step: menus everywhere

Adam wrote:
One thing that feels a little weird is moving the map - it's all "floaty" and smooth, but I think a rather "hard", direct movement would be a little better here.

Really? hmm.. well, it should be easy enough to add a "map inertia" option to the bunch

Adam wrote:
Looking forward to future versions ^^

Should be faster now that I have all the blocks in place :mrgreen:

_________________
Come on Duality's Discord channel. It's entertaining and productive! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/03/31, 20:24 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 821
Location: Italy
Role: Hobbyist
Some new updates and screenshots here :mrgreen:

_________________
Come on Duality's Discord channel. It's entertaining and productive! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/04/03, 17:43 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1948
Location: Germany
Role: Professional
Asking the important questions: When will be the next release? :D

[OT]Btw., you've got a really nice blog design. I stumbled across your ported tutorial series and it just looks polished. The kind of polished that makes you want to read it, just because it looks pretty.[/OT]

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/04/04, 08:46 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 821
Location: Italy
Role: Hobbyist
Adam wrote:
Asking the important questions: When will be the next release? :D

Eh.. I think I will still need a couple weeks to hammer down at least the basics for building management... although I could release it as it is now as an "alpha-alpha" :D It's playable.. just there are some things unused. I'll see what I can do with the few time I have in these days of holiday.

also there is the fact that I was invited for the closed alpha of SkySaga and I have only one week to try it as much as I can soooo.... ^^

Adam wrote:
[OT]Btw., you've got a really nice blog design. I stumbled across your ported tutorial series and it just looks polished. The kind of polished that makes you want to read it, just because it looks pretty.[/OT]

Thanks :mrgreen:

_________________
Come on Duality's Discord channel. It's entertaining and productive! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/04/04, 09:56 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1948
Location: Germany
Role: Professional
SirePi wrote:
Eh.. I think I will still need a couple weeks to hammer down at least the basics for building management... although I could release it as it is now as an "alpha-alpha" :D It's playable.. just there are some things unused. I'll see what I can do with the few time I have in these days of holiday.

also there is the fact that I was invited for the closed alpha of SkySaga and I have only one week to try it as much as I can soooo.... ^^


Haha, so have fun then ^^ As for the release, just do it when you feel it's ready for the next "milestone" test. I usually do releases after implementing some major features and polishing a little bit, but before beginning something new.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group