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

Login with username, password and session length

 
Advanced search

1369312 Posts in 64331 Topics- by 56336 Members - Latest Member: Mr_Germica

November 16, 2019, 01:19:22 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsRocket Shipment: A space crate delivery game
Pages: 1 [2] 3
Print
Author Topic: Rocket Shipment: A space crate delivery game  (Read 5784 times)
EberKain
Level 0
**


View Profile
« Reply #20 on: May 03, 2019, 12:41:01 PM »

Love the looks of this project.  I played a bunch of Solar Jetman back in the NES era.  Definitely interested in where you take the game.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #21 on: May 03, 2019, 08:27:03 PM »

Love the looks of this project.  I played a bunch of Solar Jetman back in the NES era.  Definitely interested in where you take the game.

Thanks! I'm planning on re-using a few concepts of Crazy Gravity, with big doors you need to open with keys you need to find, fuel you need to refill and laser shots you need to avoid. But next to this I want to make the game more physics based and a bit more puzzle heavy.

Thanks for your interest!
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #22 on: May 07, 2019, 01:07:26 AM »



Someone commented on my last post on reddit that I should take a look at the tilemap tool of Godot. I did, and the tool inspired me to implement automatic generation of the correct tiles instead of having to seperately select them.

This is the result! This means my tile selection screen can lose some unnecessary tiles, which I still have to adjust.

I still need to implement this for other tiles than soil ones, but the basic code is done!

I'm also really thinking hard about how to create hollow colliders. Each level will essentially be hollow, because the level edges will always connect...

Tips are welcome.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #23 on: May 13, 2019, 07:02:33 AM »





Here are some crates with physics. It works OK-ish.

I'll just go with it and see if the physics will really cause problems later on. I just need a break of constantly looking at the same physics code.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #24 on: May 14, 2019, 06:52:39 AM »



After a lot of effort I found out that my collisions work much more stable if my colliders don't have sharp angles.

I've updates my crates to have cut off corners, which makes the collisions more stable.

Here's a result of a small test I did. I'm really happy with the result!

My next goal will be to introduce a rope attached to the ship, to carry the crates with.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #25 on: May 16, 2019, 11:31:08 PM »



I'm taking a shot at a title graphic to display in the starting menu.
Not really sure about it.
Opinions?
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #26 on: May 21, 2019, 03:41:43 AM »



I'm amazed at how easily I could implement this. Yes it took some setting up and yes I got caught up in fixing and refactoring some stuff, but even though it took a while, the actual implementation for this was pretty straightforward.

Unfortunately SFML does not have a possibility to render bezier curves, so I'm not showing the rope being loose. Instead I've made it look like the rope length is constantly adjusted automatically to keep tension on the rope.

Anyway, here's the result!

I'll probably be pretty quiet for a few weeks. My wife and I are waiting these last few days for our daughter to be born.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #27 on: May 22, 2019, 09:59:18 PM »



Following the advice of 2 reddit users, I've tested out using a cable built out of seperate smaller joints, instead of 1 single joint.
It was actually more stable than I thought, but the weight of the cable had too much effect on the physics in my opinion.
That's why I have decided to use the best of both ways. Technically the cable is now working as a single joint, but this joint is working invisibly. On top of this I have simulated multiple connected joints that visualize the cable hanging, while not actually affecting the physics.

Here's the result of my work! I'm really happy with the cable movements.
You can see the single physical joint as yellow line when the debug mode is on.

I won't post for a while after this. My daughter will be born soon, so I'm taking a break for a couple of weeks.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #28 on: June 18, 2019, 03:42:54 AM »


I'm back from my break! Everything went well with my daughter's birth and we are incredibly happy with her.

As you can see I started working on the game again.
Previously the cable had the exact length needed when created. This means the cable will be created shorter, the closer you are to the crate.
Normally as player I would expect the cable to always have the same length no matter the distance between player and crate, so this needed to be changed.

Alongside this change I have also introduced a minimum range in which you need to be before being able to spawn a cable.

The physical effect of the weight on the ship was too intense. It was really difficult to control the ship when the crate is attached.
The ship also starts to turn when the crate pulls harder, which makes everything even more unstable.

I have solved these problems by calculating and using the mass center of the ship, and attaching the cable to this instead of the sprite center.
I have also fine tuned the ships propulsion power and the pulling effect the rope has on the ship.

As you can see the result is a much better handling ship and more realistic physics.



Next I want to create a cable shooting animation when grappling a crate.
Logged
filbs111
Level 0
***


View Profile
« Reply #29 on: June 18, 2019, 06:45:49 AM »

Nice. Perhaps deploying the cable should just dangle it. You'd then need to get the end of it sufficiently close to an attachment point on an item for it to "magnetically" stick.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #30 on: June 19, 2019, 10:09:13 PM »

Nice. Perhaps deploying the cable should just dangle it. You'd then need to get the end of it sufficiently close to an attachment point on an item for it to "magnetically" stick.

Thanks!
I did think about that approach, but am afraid it will frustrate players more than it will amuse them. Definitely when wanting to connect to a specific crate within a group of crates.
For now, I'm working on shooting the cable towards the crate and connecting on impact.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #31 on: June 20, 2019, 01:15:01 AM »



*Fling!* *Thwap!*
After some trying out different solutions, I found a nice way to shoot the cable instead of magically making it appear.
I'm simply Lerping the end of the cable between the ship and crate, but since I'm making the engine from scratch I had to program my own Lerp function first.

Since I'm only moving the end point of the cable, the rest of the cable will follow physics naturally.
The result is very satisfying. I can't stop shooting cables left and right.

EDIT: I completely forgot retracting the cable as well. Here the result for that:
« Last Edit: June 24, 2019, 12:18:55 AM by Chocolate Pinecone » Logged
poohshoes
Level 0
**



View Profile WWW
« Reply #32 on: June 20, 2019, 11:11:40 PM »

Hey, game's looking good, glad you managed to figure out the physics.  I've made a similar game and had an issue where the ship could get stuck sideways on the ground especially in corners.  I fixed it by adding an upward force when ship is touching the ground and trying to rotate.

Looking forward to playing this!
Logged

Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #33 on: June 23, 2019, 10:55:18 PM »

Hey, game's looking good, glad you managed to figure out the physics.  I've made a similar game and had an issue where the ship could get stuck sideways on the ground especially in corners.  I fixed it by adding an upward force when ship is touching the ground and trying to rotate.

Looking forward to playing this!

Thanks man! I'm glad I figured it out with the physics, even though I've rewritten that code so many times...
Rigidbodies paired with the seperating axis theorum works like a charm!
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #34 on: June 26, 2019, 01:30:45 AM »

I dabbled with different letter designs and posted a first attempt more than a month ago.
This was the first design:


Between the words I placed a flying ship pulling a crate, but it seemed too unorganized. The feedback through reddit was really helpful, and I decided to change the design to a landed ship below the title. The letters were still a bit chaotic though. Not all letters were evenly thick and some letters were more distant from the rest.
This was the image I posted back then:


I posted the result on reddit again and the helpful feedback I got was amazing! One user even took the time to draw out a sketch on improvements I could implement. I took in all the helpful advice I could get and tried to apply it to the design. This is the result!


I'm very happy with it, and am still open to suggestions by the way.
« Last Edit: June 26, 2019, 05:56:17 AM by Chocolate Pinecone » Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #35 on: July 05, 2019, 12:26:44 AM »



Now that I started on the start menu, I automatically started thinking about implementing localization. I have now built a localization class that holds all translations for specific texts.

To test this I have implemented a language change and scene update whenever the "Options" button is pressed. As you can see it works just fine!
I'm very happy with this result and have learned a lot in the process.

For example I didn't know I could NOT store CJK characters inside a simple string. The characters needed for these type of words needed to be bigger, so I should either use wchar arrays or a wstring.
Luckily SFML supports entering wstrings directly into a Text, after which it will automatically render the CJK font characters as intended.

Because I use separate fonts for EFIGS and CJK, I have programmed a function that will change the used font when changing to a different language. It also changes the character sizes, because the CJK characters size 30 is much smaller than the EFIGS characters in size 30.

A great start for further localization!
Because my game will not have much text, I hope to be able to localize most text using the Polyglot game translation table. In the end I probably only have to pay for localization of my game page and achievements.

Next step is adding a credits button and making the options menu!
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #36 on: July 10, 2019, 10:32:55 PM »

Localization, a save and load system, encryption. So much work that is not visible to the end user.
I sometimes underestimate the work that still needs to be done. Just when I think I see the end of the tunnel, a new subsystem needs to be programmed.
I love it though. I love the intricate things I need to think about, the way I have to carefully plan out every system so it not only works well, but is also easy to come back to later.
Making a game from scratch is a long and tedious journey, but it definitely makes me feel like you can program anything. Not because I feel like an expert or anything, but because I experience time and time again that I tackle complicated problems by logical thinking and perseverance.
I solved complex challenges that frightened me by patiently trying out different things and reasoning logically. Experiencing this again and again, really boosts my self-esteem as programmer.

I read a lot of different advice on programming your own engine. Most of it boils down to the question: "What do you want to gain, doing this?". And I agree, this is the question it is all about.
If you want to make a game quickly, don't do it. But if you want to build your skills as a programmer, and make a game in the process without a hard time limit, go for it!
It will surprise you how much there is to a game engine. Initially I thought it would be something like a renderer, save/load system, physics system and sound system, and that would be about it. Boy was I wrong. I only scratched the surface.
Localization, Tiling, Scene managing, Animation, texture managing, sprite managing, spritesheet managing, a GUI system, Math and geometry utils, the list goes on. There is no overestimating a custom engine, I learned that pretty quick.
Yes it is much easier to pick up Unity3D and not even have to think about most of these systems, but there's one massive advantage that Unity3D, or any other engine for that matter, cannot give you, and that's transparency. There is no part of my engine that I do not understand.
Any part that was incredibly complicated has been programmed and sufficiently documented by myself. I know exactly what my engine is doing, when it is doing it and why.
There is no black box in the game. When I find an issue, it always comes from MY code. If there would be an issue in a black box, you're screwed!

No disrespect to the commercial game engines of course. I programmed my first games in Unity3D and I'm glad I did. I would never kept programming games if it would be this hard.
Commercial engines do the tedious and complex stuff for you and leave you mostly to the fun parts.
I just wanted to know how it all worked, and I also wanted a non-graphical engine to program my game in.
I'm glad I took the path I'm on and I'm exited to keep working on this project.
There is no school like experience, so don't be scared to follow your curiosity and remember to have fun in the process.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #37 on: July 15, 2019, 11:52:18 PM »

It's very annoying not to be able to show much progress to you guys. I've been working on a lot of things under the hood and thinking about localization.

There's a lot of work to be done for all the menu's. The Options menu alone already is a huge task, mostly because it will introduce some UI element I have not created before.
For example, I want to implement a simple drop-down menu for selecting the resolution and the language, which has to be built from scratch.
Next to this, I've also investigated which languages to support in the game.


Countries by their proficiency in the English language (source: https://www.andovar-game-localization.com/what-languages/)



Top 20 markets worldwide in terms of gaming revenue in 2014 (source: https://www.andovar-game-localization.com/what-languages/)


Adding the countries with the biggest game revenue and a poor grasp on the English language I've decided to go for English, French, Italian, German, Spanish, Russian, Simplified Chinese, Traditional Chinese, Japanese, Korean and my native language, Dutch.
I figured I would be robbing myself if I didn't translate into the languages of the huge Asian game market.

I'm booking a little bit of visual progress though. I've created the base start menu, which has a slowly moving background of stars. The movement direction and speed is determined randomly each time when the start menu loads.


Moving background in the start menu


The Start button currently directly starts the first level it can find. The Options button now switches to the Options menu, which is still empty except for a working Back button.


To the options and back!


I've implemented a "Toggle Language" button in my debug menu so I can test out all the languages whenever I want. This will come in handy to check if translations fit the buttons, and to check whether the fonts support the characters for specific words.
I've been able to find a pixel font that supports the latin and cyrillic alphabet, the latter being used for Russian. For the Chinese/Japanese/Korean characters I found a separate pixel font that is slightly different. Because of the difference in size, I have programmed the font size to adapt depending on the font to make sure it still fits in buttons and other GUI elements.


Toggling languages through my debug menu. You can see the font change to CJK characters messes up some debug info, but the players won't notice any of that Smiley


Next to all these changes I've also ironed out some issues when switching between menu scene and playable level.
All in all a lot of changes, but no really exiting stuff to show you guys.

Expect some more boring posts after this, cause the light at the end of this GUI tunnel is not yet seen.
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #38 on: July 23, 2019, 10:43:56 PM »



I'm booking nice progress with the options menu.

I have made a reusable dropdown component that supports scrolling though buttons and the mouse wheel.
At first I wanted the text to smoothly scroll in and out of view by partially rendering the text when it's partly outside view, but unfortunately SFML does not really have a good option for that.
I could convert the text to a texture and then partially render it through a sprite, but this just seems like too much effort for a very small detail. I chose to scroll text completely in or completely out, avoiding this situation all together.

My first scroll attempt was pretty hilarious.



But a few adjustments later, scrolling was working like a charm.



Technically the dropdown component reuses my TextInput component used in the save menu (to enter the save file name) and als reuses the SelectionTable component I made for the tile editor.
The TextInput is used for the top part of the dropdown that will show the surrently selected value. The SelectionTable is used for the scrollable options part that also highlights the currently selected option.
The SelectionTable already had the selection colouring implemented. I simply expanded the class to support scroll buttons as well, and voila, a working dropdown!



Thinking about the settings I should add, the amount of work seemed to continuously increase.
I want to implement settings for resolution, language, controls, fullscreen/windowed mode, brightness, and of course music and sound. The language setting is easily implemented because I already finished the base localization code.
The other settings need some more investigation. SFML seems to be able to handle the difficult parts regarding the resolution and fullscreen/windowed settings, which is nice.
The controls however are currently hard coded, so I will have to create some mapping in between for those settings. The brightness setting will introduce me to the world of shaders. I will make a shader that brightens or darkens the whole screen based on this setting. It will be my first shader ever, which is exiting, but also daunting.
I've honestly never worked with shaders, let alone wrote them. They always sounded like this hugely complex magical thing that only wizards could conjure.

All in all, coding these settings is a big task. But I'll probably gloat in pride when it's done!
Logged
Chocolate Pinecone
Level 0
***



View Profile WWW
« Reply #39 on: August 05, 2019, 03:55:14 AM »

I've been working on encryption.
I want to be sure the level and save data cannot easily be modified in a text editor. Currently the stored level data is completely human readable and can easily be modified in notepad.
To mask the data I've made an encryption and decryption function that will be called before writing all data to the file.
It's very interesting to see all different kinds of encryption, and I'm not afraid to tell you I've chosen for a simple XOR encryption.

Encryption always sounded so complicated, as if it would require hugely complex mathemetical functions, but this was not too bad.
I even took the time to write a small separate tool for en/de-crypting files!

Just to share my learnings, here's an explanation of how XOR-encryption works basically:

Say you want to encrypt a simple string "hello". This string is a group of letters which we as humans can read and understand. A computer however, cannot.
For a computer to understand data, everything in computerland is eventually represented by 1's and 0's.

This is because the computer consists of hardware that stores everything in states of either 'present' or 'not present', '1' or '0'. In hard drives, for example, these are represented by magnetized areas. Each one of those areas can be independently magnetized (to store a 1) or demagnetized (to store a 0).
Magnetism is used in computer storage because it goes on storing information even when the power is switched off. Metal keeps it's magnetized state.

Back to our example, the string "hello" would in computerland be represented by 01101000 01100101 01101100 01101100 01101111. Here each byte (8 bits) is representing a letter or character of the string.
To encrypt this with XOR encryption, we would first need a key string. Let's, for the sake of simplicity, choose "crypt" as key.
Now, when XOR encrypting, we simply change each bit of each letter based on the letter in the same position of the key string. But before we look at that result, let's first see what a XOR operator does.

XOR stands for exclusive OR, which compares 2 bits and only returns a 1 when one of both bits is 1.
These are the results of all possible XOR operations:


Source: https://www.dyclassroom.com/logic-gate/xor-and-xnor-logic-gate

Our text "hello" will be XOR'ed with the key "crypt":



The encrypted text 00001011 00010111 00010101 00011100 00011011 cannot be represented by standard ascii characters and will probably be represented in a text by "    ".
So we've successfully encrypted our string, yay! However, we probably at some point want to use the stored information which is now unusable. We must first decrypt it!
This is where the simplicity of XOR-encryption shines. When we XOR our encrypted text with the key "crypt" again, we actually get back our original text!



Neat, huh!
Now, XOR-encryption is not the safest type of encryption by a long run, but for a simple game file it does the job well enough.

A level file in my game now looks like this:



After some hard work I've gotten en- and decryption working and also integrated this with writing and reading from files through my generic engine classes.
Now I'll focus my efforts on storing a user settings file (which will not be encrypted) and linking the options menu to use this file.
Logged
Pages: 1 [2] 3
Print
Jump to:  

Theme orange-lt created by panic