Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Apr 2013
Offline Last Active Sep 08 2015 11:41 AM

#5213470 Give me your Java and Python code

Posted by plainoldcj on 28 February 2015 - 04:16 AM


at the moment I'm heavily procrastinating, so I thought it's a good
time to refresh my language knowledge smile.png

Therefore, I'm asking if one of guys has a small game (around 10k loc maybe)
written in Java or Python that I can tinker around with.
Ideally, the game has only a few library dependencies. Also, the code should
be "java-ish" or "python-ish" (as opposed to translated from, say, C), so I get
to learn common idioms and standard libraries.
Open source games are fine, too.

So, any suggestions? smile.png

#5209053 Filling in the gap: What to do while waiting on the game to finish an action ?

Posted by plainoldcj on 06 February 2015 - 08:09 AM

They seem to create constant opportunities to carry out tasks by deliberately making the interface non-user-friendly in very specific ways!

That's interesting, I haven't thought about it this way before. I don't know much about SC2, but I've played WC3 a lot (lot).
In WC3, there are research queues.
Both games focus on micro-management of single units or small groups of units. That's a design decision that forces you to have little automation (including AI) of movement and casting, because that's how players compete. I like the idea, that most of what happens is caused by direct
player input.

I agree that the player has to carry out a lot of tasks, but I don't think they want to keep the player busy clicking.
The assignment of drones to minerals, for example, has been automated in SC2, simply because it's a boring task with no
consequence for the outcome of a match.

#5181079 OIT (Order Independent Transparency)

Posted by plainoldcj on 17 September 2014 - 01:19 PM

Maybe it's already sufficient for your application to sort the individual triangles back-to-front.

You can store the vertices statically on the gpu and issue a sorted list of indices in every frame,

for example. It's not too bad.


If you really need perfect transparency you may consider depth peeling.

It's a multipass technique and runs on older hardware.


The cheapest trick is to draw in any order and tell everyone it's correct.

Most people don't notice alpha-blending errors anyways :)

#5180843 Panning camera so object is at edge of screen

Posted by plainoldcj on 16 September 2014 - 04:29 PM

Think in terms of frustrum planes, not view rays.

You could try something like this, again using the right frustrum plane for example:

1. get the plane equation

2. cast ray R along x-axis to find object-plane distance

3. move camera along x-axis so that distance is 0

depending on the object or which bounding geometry you use you should

sample the distance at every vertex and use the minimum or something like that.

im not really sure what you are trying to do. after the camera translation the object

should still be outside the camera view, right?

#5178823 Orthographic projection causes artifacts

Posted by plainoldcj on 08 September 2014 - 04:29 AM

Hmm. To my surprise the problem disappears when I choose a sufficiently large negative value for the near clipping plane.

So before I set (znear, zfar) = (0.1, 100.0) for both the perspective and the orthographic projection matrix and the error

occurs. When I choose (znear, zfar) = (-100.0, 100.0) for the orthographic matrix everything looks fine.

I have no idea why. Since setting znear = -100.0 essentially doubles the viewing volume I would guess the error

becomes even worse!

#5153395 Karatsuba algorithm

Posted by plainoldcj on 13 May 2014 - 02:35 PM


could it be that you override memory? You could try
changing func(A, B, A) to func(A, B, C) and see what happens then.

A note on bignums: you mentioned that you use base 2. I think the typical
choice is base 2^n, where n is the number of bits in an int-value.
This simplifies things as you can add two digits using ordinary + operator

#5151574 why in many fps games player character doesnt talk?

Posted by plainoldcj on 05 May 2014 - 04:15 AM

Prey, anyone? Here's a link of the intro and it's first person dialogues: 


Tommy's voice adds tremendously to the atmosphere of the game.

Note that he often expresses feelings like fear and anger and doesn't scream "Hell yeah" on kill streaks or something like that.

He has a (minimal) background story, worries about his grandfather and his girlfriend and is not some generic hard boiled soldier.

I wouldn't say I identified myself with Tommy, I just enjoyed watching his story and help him with the shooting.


The voice acting was good and Tommy's voice was distinctive enough so I was at no point confused who was talking.

Image you play something like "Die Hard - the game". Would you be confused who's talking when you're character has the voice of Bruce Willis?

#5144750 Linked List vs std::vector

Posted by plainoldcj on 06 April 2014 - 10:10 AM

This issue is covered by a lot of good talks.
See by Stroustrup or
http://channel9.msdn.com/Events/Build/2014/2-661 by Sutter, using the
same example.

#5140305 Splitting a rectangle area into organic section.

Posted by plainoldcj on 19 March 2014 - 06:28 AM

I just want to give you the name voronoi diagram.
I've only seen the case where the "influence" of a point is the euclidean distance. That is, for each point p
of an input set you get a corresponding "section" (cell) which contains all points which distance to p is not greater
than to every other point of the input set.
So it doesn't actually fit your problem but I imagine there are other forms of the vornoi diagram which solve your problem.
Or maybe you find a way to make the borders fuzzy, don't know.
You're picture reminded me of this, so just use this term to google smile.png

Note, however, that most algorithms for voronoi diagrams compute a representation of the borders of the section, like a graph, for
instance. I could imagine that's not what you need.

If you just want to draw such sections, why not draw several predefined sections on top of each other? This should even work
with picking.
You could use metaballs to generate sections.

What are you trying to do, anyways? smile.png

#5107822 Is hacky code allowed in industry?

Posted by plainoldcj on 08 November 2013 - 02:02 AM

Read this: http://gamasutra.com/view/feature/194772/dirty_game_development_tricks.php

#5100218 Computational Geometry Algorithms to Determine Rooms in a Dungeon (or a Build...

Posted by plainoldcj on 10 October 2013 - 10:20 AM

The first step for solving this problem is defining the term 'room'.



Assuming it's not possible to do the grouping yourself in the editor, because you generate dungeons at runtime, I'd advice you to ask

the developer of this plugin. It looks like the dungeons are glued together from predefinied pieced anyways, so ask him to include

triggers for the 'glue points'. After all, you paid a lot of money for this :)

#5096604 Well Structured Code

Posted by plainoldcj on 25 September 2013 - 04:49 AM

I've always wondered how to write games in a way that it is easy to read and object oriented so that I can easily get and set a players health. [...]

So innocent smile.png

#5092713 Best free Unity3D modelling software?

Posted by plainoldcj on 09 September 2013 - 07:45 AM

Try Blender with Linux. Hopefully this solves your Intel driver issue.

#5092669 Screenquad vs compute shader

Posted by plainoldcj on 09 September 2013 - 05:16 AM

Profile both approaches?

#5087315 Programmer's "writer's block" and getting bogged down

Posted by plainoldcj on 19 August 2013 - 09:39 AM

Basically, I'm finding my head being a clusterfunk of ideas and can't seem to find a good place to start without getting bogged down. Does anyone have any advice for dealing with this?

Remind yourself to code fearlessly:
Create a new branch of your code to play with and simply start typing.
Don't try to come up with a perfect design first for all anticipated features.
You get the most valuable insights by actually trying to implement stuff!