fangzhangmnm

LD 38

Please help me clean my dormitory!

Help me! Last week a I speed three sleepless days on Ludum dare, with a lot of junk food and soft drinks. That makes my dormitory a garbage dump.

Now I found that I have some * terrible * roommates.

In my game you will control a puppet maid to beat the worms in my dormitory.

Play game

* https://ldjam.com/events/ludum-dare/38/clean-the-dorm *

Controls

  • WASD move
  • Space jump
  • LeftMouseButton attack
  • RightMouseButton block

Screenshots

无标题.jpg 无标题2.jpg 无标题3.jpg

Ps

This is the first time I take part in Ludum Dare.

Technical Sharing: How I make a photo-based AR game

Technical Sharing: How I make a photo-based AR game

Hello everyone. Finally I've finished my mid-term exam so I have some time to explain how I use reallife photos as game scene.

Actually, I was inspired by FF7. That famous game also uses a prerendered photo as the game scene and only draw the animated characters realtime. That makes cinematic scenes real on PS1.

So I decided to adopt this technique. There is a trade-off. The photo will makes my game more like a amateur game. But I think the innovation worth that defect.

First of all, welcome to play my game:

* https://ldjam.com/events/ludum-dare/38/clean-the-dorm *

ss1.jpg

Rendering Technique

In unity3d One can decide the order object was drawn with the * Render Queue * property of one material. In may project, the Render order is

Step One

First we draw the photo as the background image using a unlit shader with a camera space canvas with ZWrite on.

Step Two

Obstacle phase. What is an obstacle? In the scene view I turned on wireframe mode. We can see a lot of transparent boxes. They are the simplified geometry of the reallife scene.

QQ截图20170504133342.jpg

The Obstacles plays 3 roles: - Colliders in the gameplay - Cut the virtual objects out if they should be obscured by the reallife objects. - Receive the shadows of virtual objects and blend them onth the reallife photo.

I should emphasize the importance of shadows. Not because they increase the sence of reality. The Irreplaceable role shadow takes place is that they indicates the spacial relationship of objects. Without shadow one cannot tell whether the character in just on ground or floating in air. They cannot tell if it is a big character near the camera or a small character far from the camera.

Let's draw the obstacles. we keep ZWrite on, writing the depth of all the obstacles to block out the virtual objects to be drawn. We donnot use opaque mode to override the background photo by litted color. We use transparent mode, calculate the shadow intensity of the fragment and alpha-blend it onto the photo.

Step Three

Draw the virtual objects. I means the characters, the monsters, the particle fxs... Since the depth buff is already set by the obstacles, when the character should be occluded out by reallife objects, they cannot pass the depth-test.

Step Four

Ofcourse it's for ui.

Shaders for obstacle

``` Shader "FX/Cutout" { Properties { _Color ("Shadow Color", Color) = (1,1,1,1) _ShadowInt ("Shadow Intensity", Range(0,1)) = 1.0 _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 }

SubShader { Tags { "Queue"="Geometry-20" "IgnoreProjector"="True" "RenderType"="TransparentCutout" } LOD 200 ZWrite on Blend zero SrcColor

CGPROGRAM

pragma surface surf ShadowOnly alphatest:_Cutoff

fixed4 _Color; float _ShadowInt;

struct Input { float2 uv_MainTex; };

inline fixed4 LightingShadowOnly (SurfaceOutput s, fixed3 lightDir, fixed atten) { fixed4 c; c.rgb = lerp(s.Albedo, float3(1.0,1.0,1.0), atten); c.a = 1.0-atten; return c; }

void surf (Input IN, inout SurfaceOutput o) { o.Albedo = lerp(float3(1.0,1.0,1.0), _Color.rgb, _ShadowInt); o.Alpha = 1.0; } ENDCG }

Fallback "Transparent/Cutout/VertexLit" } ```

* Important, You need to rewrite a new unlit shader in order to customize the Render Queue. The default unlit shader template is just ok. *

TODO find the original post I find the shader and make credits

Scene Setup Workflow

Camera Alignment

How to align the camera with the photo? Because the time limit I didnot try to challenge the maths monsters of computer vision. Instead I align the scene by myself.

First I googled my camera's field of view. There is something subtle: The field of view of reallife cameras are measured by the diagonal line of the sensor versus focal length. However in computer graphics the fov means the vertical height of the sensor versus focal length. It needed some calculation and I found my iphone6's fov is 34.55 Deg when it takes videos.

Later I found that several degrees of error in fov doesn't matter.

QQ截图20170504140043.jpg

After setting the camera I should * align the camera to the scene *. If you are familiar with maths of transform, you will notice that it is identical to * align the scene to the camera *

It will be good if I can rotate the ground grid. How I cannot. So I created a virtual cube called "coordinate"

QQ截图20170504140517.jpg

Then I selected the camera gameobject, Menu-GameObject-Align View to selected. Now we can edit the scene from the perspective of camera.

QQ截图20170504140746.jpg

Now ,select the "coordinate", move, rotate and scale it until it fits the scene.

QQ截图20170504141159.jpg

  • One cannot perfectly fit because the error in fov and the lens distorsion
  • donnot worry the z-position (distance to camera) of the coordinate. You can only align the xy-position, since the increase in z-positioin is identical to the decrease of size.
  • according to maths, you can synthesis z-rotation by x-rotation and y-rotation. There is only 2 degree of freedom in rotation.

Finally, I will show you the magic.

Since the "coordinate" is aligned with the camera. You can build the ground or something else under the transform of coordinate. Now we want the coordinate transform to be the world transform. How to do that?

  • Drag the camera into the coordinate gameobject
  • Reset the coordinate's transform to 000 position, 000 rotation and 111 scale
  • Drag the camera out of the coordinate gameobject

The unity engine will automatically calculate the camera transform if the camera was transformed by the same transform that transforms the coordinate to world.

QQ截图20170504142200.jpg

Finally we will decide the actual size of the scene

  • Drag the character into the scene and make sure her transform is identical, and she is not under coordinate gameobject

QQ截图20170504142328.jpg

  • Drag the camera into the coordinate gameobject again
  • Scale the gameobject until you are satisfied with the character's size

QQ截图20170504142459.jpg

  • Drag the camera out of the coordinate gameobject.

Congratulations! You have finished setting up the Camera.

Fitting in the obstacles

As I mentioned before, From 2D picture one cannot get enough information about the object's actual position. One cannot tell if it is a small object near the camera or a big object far from the camera. Luckily we can infer more relationship form the shades and common knowledge.

The common knowledge I used is the fact that most of the objects are on the ground. They are not floating in the air. With this addition information I can obtain the object's actual size and distance.

  • create a cube
  • assign it with Cutout material
  • Wrapped it with another gameobject called "CubeObstacle". Make sure the cube's local transform is (0,0.5,0;0,0,0;1,1,1). That makes the gameobject's origin is on the bottom of the cube
  • Make the "CubeObstacle" a prefab
  • Also, you can make more prefabs such as cylinders or horizontal cylinders or spheres and so on
  • Create a plane with Cutout material and name it "Ground"
  • Make sure the plane's position is 000. Then size it bigger.
  • Select the camera, Menu-GameObject-Align View to selected.
  • Now From the camera perspective, drag the obstacle prefab from the project tab onto the Ground gameobject. That will make sure the obstacles are on the ground. So you can drag them to the correct position according to photo
  • Size and rotate the Obstacle to fit the photo. Donnot size the cube gameobject, size the CubeObstacle gameobject.

无标题.jpg

QQ截图20170504145129.jpg

Additional Mention

  • Donnot forget to set up the lighting correcting. I used a directional light for shadows. And I use photos to make a cubic skybox for ambient. You can use the same photo for 6 sides of the skybox since skybox mainly provides low-frequency lighting informations.
  • Donnot use your dirty uncleaned dormitory to take photos. Art is someting atrificial instead of natural. Actually I cleaned my dormitory first then mess it up manually, to carefully design a game level.

I just wanna to see if I can get more reviews when I remake the game cover image

Title.png

a) I've get more than 30 reviews. So if you are going to "rescue" some games without enough reviews, eh, you are welcomed too.

b) However, I've seen many excellent games getting only a little reviews. LdJam is getting bigger and bigger and there are a lot of games to play and a lot of great people making great games. I'm wondering if there is a lot of people judge the game only by its cover image. I donnot blame them. Because I did so after I reviewed dozens of games and getting tired. So I decided to remake my game cover image.

c) Welcome to play my game: * https://ldjam.com/events/ludum-dare/38/clean-the-dorm *

d) How I make my game: * https://ldjam.com/events/ludum-dare/38/clean-the-dorm/technical-sharing-how-i-make-a-photo-based-ar-game *

e) I'll keep on updating the list below about some very excellent games that worth more than 20 ratings. I think you should play them first after playing my banality game. I'll sort them by how excellent they are:

List of low-rating-high-quality games

* https://ldjam.com/events/ludum-dare/38/a-social-network *

I beg you play this game. I'm so surprised to see this game in the "Danger Category". When I first see during the jam, I think it must be the top-20 ones.

6b6.png

* https://ldjam.com/events/ludum-dare/38/prison-blues *

2254.png

* https://ldjam.com/events/ludum-dare/38/evo *

Another carefully made simulation game.

27d1.png

* https://ldjam.com/events/ludum-dare/38/save-the-little-world *

12c7.png

f) Although this time ldjam have a lot of mess, It is the first time I take part in ldjam and I really enjoy it. Thanks everyone.

LD 39

My suggentions on Ludum Dare

  • I want an api to log which level my players achieves. Or high scores, gameplay times. An achievement system like the one on steam, i mean. Maybe show them on the comments. It is a good feedback and can avoid someone donnot play the game but only comment to get karmas.
  • I want a search game function. My parterner gives me some good games she downloaded, but I donnot know the game's webpage, so I cannot comment.
  • VR special column. Only few on this jam can play vr games, but I have many good vr points and like to make vr minigames. I think it should be listed out for the vr users

LD 40

I wonder if I had many ‘imoto’s

This time I decided to make an anime fanart game using tic-80. I was inspired by the idea of letting the protagonist suffering danmaku attacks of multiple anime heroines

Progress

umr (2).gif

getting bored on this stupid idea. sigh

Pants Attack!

pants.gif Wake up and you haven't start to make the music yet :n

Game Updated

cover.png

Play

Optimized some guidance where player would get confused and stuck

And, as the asked, REDUCE THE NUMBER OF PANTS. This should be a great news.

Tips: To get informed

This time I'd like to introduce a website for those who are new to ludum dare. The webside is called Feedback Friends.

http://feedback.ld.intricati.com/?event=49883&sorting=smart

From this website you can not only see how your karma is calculated, and find a lot of games in a new sorting method, but also you can see if someone is watching you. That would be much more helpful than the spamming notification system.

_ If you still think this post was yet another an advertising spam, you can click my username to play my game _

warning

by RobinHoodPT (@robinhoodpt), published 41 minutes ago You should add to the post that it’s outdated and doesn’t currently works with Ludum Dare Teams. Only the Team Leader will influence that site. So the ratings on LD are different than on FF.

Happy Friday Play Games

  • Angstrom Interactive Private Beta An oldschool console simulator. Lack of game goals, but really fun to explore. The character-rain gfx and typing sfx are good

  • Bunion

    1 Cute game in this jam.

  • Catamari Rotate a spherical cat to put its very small head on the correct position to eat sausages. Very stupid.

  • Dead End Office Nobody hates picking up money! And the educative ending didn't make the player feel uncanny, that's rare.

  • Don't get drunk Just a really simplistic 2d platformer runner game and a really simplistic idea of screen distortion to simulate drunk feelings. Then the chemistry reaction makes it a really humor game.

  • Horny Bunny Just a fucking game. Literally.

  • House Party Physics simulation punching game

  • Loot Drop A REALLY FRUSTRATING GAME. If you have strong nerves, try it

  • Mining Empire A really addictive game made by a novice developer. Collect, Upgrade, Exterminate, Expand. What else do I want?

  • Rabbit Farmer!!! Exponent inflation is evil, smashing rabbits is evil too!

  • Sailor Wolf Really a depressive game of the topic "You cannot save them all"

  • Sores An artist joined our jam to call on people to care for the poor. However, he didn't do that correctly, for the gaming mechanics didn't fit the mood. Anyway, support ya.

  • Sugarplum Summit A stylish shooting game

  • TetrisTank Made by my compatriot. Just support ya.

  • The Provocateur Collect people, capture buildings, produce rebellion and fight against cops. It's so frustrating a game because you are easily to die accidentally, but it's addictive enough to make you a second try.

  • Quantum's Rick Another stylish game.

  • MY GAME Why I'm spending my afternoon writing this advertising post?