Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Concept Storm - September Programming Contest Part 1


Recommended Posts

First, I'm dropping the number of problems we are doing for the contest from 10 to 6 due to hearing from people that school was keeping them from wanting to do this, so instead of having 5 per two week session, only 3 problems will be done per session.

Again, the format is such that you can do the problem in pretty much whatever language or platform you feel like. These problems do require that you can make a graphical representation of each simulation though, so be prepared for that. If you are Java programmer and don't know much about graphical stuff, I'd suggest Greenfoot. It's a pretty neat thing made by the guys who made the BlueJ IDE that allows you to make little simulations using java programming with a bunch of 2D graphical features built in and made pretty easy to use.

Naturally, since this is a game forum, these examples will be less focused on pure math and more focused on behavioral programming.

1. You have a 5 story building with 2 elevators. Elevators have two movement modes and an idle mode. Program a simulation of the elevators where you can press either elevator's call button on any of the five floors and you can push any of the elevator's floor buttons at any time. Elevators in up mode should not switch to down mode unless there are no existing calls to a higher floor. Vice Versa for the down mode. In idle mode, modes can switch. If the elevator has a call or a destination at and arrives at a, the door should open and close some short time later. Active buttons should have some indication of being active such as a yellow color.

2. Mario is trapped between two columns of tiles restricting his x movement. All he can do is jump. A bullet bill cannon is shooting for his head with bills of random velocities (test it at a few speeds, provide me a way to choose a speed). To make matters even worse, Mario is wearing concrete shoes and can only jump in a way that he is able to get above a bullet bill for 3 frames. Mario is a smart guy, so he should be able to look at the bill and time his jump so that he bops the bill. Program this.

3. 640x480 A vehicle is moving in a fixed location up and down at an in-determinant speed (test it at a few speeds, provide me a way to choose a speed). A guided missile is approaching from the right side of the screen from the center at 20 pixels per second (use your trig) that can only rotate at a fixed speed of 30 degrees per second. Program the missile's guidance system so that it can always hit the target. (note that there is a hard way to do this and a piss-easy way)

The first three problems are all due for judgment on Saturday the 18th of September. These are all pretty easy I think, but definitely helpful exercises for people who are into behavioral programming.

Link to comment
Share on other sites

A bullet bill cannon is shooting for his head with bills of random velocities

...what? Does this mean there are random bills at random speeds all over the place, or that the single bullet bill moves at a random speed?

No other concerns besides that. Lots of time for each of them, and the third is pretty easy. I think I'll try this just to keep my mind active.

Oh I do have a concern. You mentioned graphics being necessary. Say for the Mario problem; do you require the actual mario sprites being used, or can shapes as placeholders work well enough as long as the example is visual? I'd honestly rather just do the programming aspect of this rather than dig for and compile sprites.

Link to comment
Share on other sites

There is a single bullet bill cannon which shoots at the bullet bill at the same tile level as Mario (use little Mario for reference). No, the actual graphics aren't necessary and any other graphics may be substituted.

By random velocities, I mean the speed of the bullet bill can be anywhere from 1 pixel per frame to 10 pixels per frame or any fraction of a pixel in between those two values. Mario must be able to account for basically any velocity between those two pixels, but only one bill can be on the screen at a time.

Feel free to use rectangles and squares to represent everything.

One more thing about the jump movement with the Mario problem. The jump must be constant acceleration. If a 3 frame window proves too difficult to maintain, up to 5 frames will be acceptable, as that was more of a way of describing the problem rather than a set in stone requirement.

Link to comment
Share on other sites

Sorry, I reread the bullet bill thing and your wording makes perfect sense now.

Last question:

A vehicle is moving in a fixed location up and down at an in-determinant speed
Program the missile's guidance system so that it can always hit the target.

The vehicle needs to go up, and then smoothly or instantly start going down, and the vica versa? If so, are you saying that by the missile always hitting, it cannot miss? I'm asking since if it cannot miss and the vehicle has to change movement direction back and forth, I'd have to figure out a way for the missile to predict the vehicle will have changed directions by the time it reaches its position to start turning early, which would complicate things.

Link to comment
Share on other sites

This missile is not allowed to miss. The vehicle is constrained in the x coordinate, so it can only move up and down. The actual motion of the vehicle doesn't matter too much as long as it isn't randomly teleporting around in the y axis.

And yes, there is a cheateriffic way to take advantage of the fact that it can't move in the x coordinate and I'll count that method as long as you figure it out on your own and don't share it with anyone.

Link to comment
Share on other sites

Here's an example for question 1 that I whipped up pretty quickly today.

Requires JRE. Launches out of the .bat file. Made using Java and the greenfoot IDE. I'll include the project files and source code once the competition is over... though it's pretty sloppily thrown together. All graphics except for the base frame of the elevator are made by me. The elevator was stolen from some cryptic website that didn't really explain any of it's stuff.

For question 2, I'm going to use C# and SDL.

PCQ1.rar

Link to comment
Share on other sites

  • 2 weeks later...

Question set 2:

4. Simple boss

The player encounters a boss! Your job is to program the boss. Upon entering the battle, the boss runs in the direction of the player at a set speed and when he gets within 30 pixels or so, he does a short hop going just above where you'd expect the player's hitbox to be.

From here he pauses for a brief moment to assess the player's status. If the player is less than 120 pixels away, he'll do a long jump high into the air, stop above his head at the apex of the jump come down. If the player is more than 120 pixels away, he will run off the opposite end of the screen and come back on the side the player is on before charging through back to the original side of the screen he was on. Depending on which move he used, when he goes back into assessment mode, he'll swap the move that was used for the move that wasn't in the selection.

So here is an example of the flow:

Boss uses run + short hop

Boss assesses (sr: slam jump, lr: charge away off screen and loop)

Boss goes with charge away off screen and loop.

long range move gets swapped for run + short hop

Boss assesses (sr: slam jump, lr: run + short hop)

Boss goes with short range, uses slam jump

slam jump gets swapped for loop around.

I hope that gets the point accross. basically you are just swapping in the moves he uses at the ranges.

The idea here is to have the states machine, but to be swapping what the states mean in a clever sort of way. The problem itself is pretty easy, but it's also a good example of making a somewhat tricky to read boss (though easy enough to figure out).

EDIT: OH yeah, I forgot. You don't need an actual player object to be there and you can simulate the player's X Position with whatever really. A mouse, a cursor controlled by the keyboard, etc.

5. Cheese Bridge

Make a platform that sits until it is told to move (jump on it, click it, whatever floats your boat). Once the platform starts moving, it moves along a visible line until it either runs into a block that turns it around or a gap that let's it just fall off. Lines should be capable of running at a 45 degree angle from the horizontal axis and vertical. If the path terminates going vertical/diagonal, the platform should jump off the path at that angle. While in a falling mode, the platform should then be able to rerail itself if it falls on a rail. If it falls after running vertical back onto the track it fell off of, it should start moving in reverse. Unlike in the source material, I won't make you bother with round paths.

Note: This is a lot easier if you are using tiles as your method for placing the paths. Also, a state machine will probably be necessary

I'd classify this problem as an advanced gimmick. I'm counting it as two problems and it's worth as much as doing two problems if you pull it off correctly.

Also, if you are participating and have anything to show, please send me a PM with a link to a rapidshare or something so that I can check out your work by close of business tomorrow.

*Crosses fingers that someone actually cares*

Link to comment
Share on other sites

Alright, I'm beginning to think that no one's going to submit anything tonight... which does make me sad.

Tell you what, if anyone wants to participate, they can just send in whatever problems they finish by the end of October 3rd. 5 Rep / problem and a special thing will be added for participation. And just do whatever problems interest you, don't fret about doing them all.

Link to comment
Share on other sites

Alright, sacrificed some sleep to give DW some love. I kinda pulled this together sloppily so that it wouldn't take too long, but I think it follows all the guidelines.

Concept Storm - September (Problem 5)

F2 resets like always; use Space to set the onrail velocity to 0 so you can mess with it on certain situations such as being stuck in a dip.

Link to comment
Share on other sites

More elaborate than I was anticipating, and probably not quite as suitable for making a controlled level, but I'll be damned it if isn't awesome and close enough to spec.

Still needs a turn around block - IE: an obstacle that the platform can run into and then get it's direction flipped. Also the ability to do the same thing basically when it goes straight vertical during a jump.

That's worth 2, so uh... yeah! Fix that little thing and I'll give you credit for the 3rd.

Link to comment
Share on other sites

Work due tonightyay for extensions combined with baby duty is making this a nerve wracking day. I guess I managed to read over those points I missed. The thing is programmed so sloppily that the vertical bar had to be a special object. =E

Concept Storm - September (Problem 5b)

Wasn't entirely sure what you meant by the stopper block reversing direction, but I'm guessing you just meant like a wall having it rebound. Fully reversing the speed seemed awkward, so I made it lose half upon collision.

Press Enter to see the second frame with the additions, and press Enter again to reset that specific frame. As the on-screen directions say, left clicking will place a stopper block at the mouse coordinates.

Link to comment
Share on other sites

Concept Storm - September (Problem 1)

No idea if this even counts for points since it is late...

With DW's permission, this example uses a buddy system, where each elevator has to decide who answers the floor call based on what one another is doing. The decisions are sometimes a bit awkward, but in general it seems pretty solid and tries to acknowledge that each elevator wants to keep traveling in the same direction as much as possible.

Due to the nature of the system, I used quite a few buttons. The center green buttons are floor buttons (external to the elevators) that when pressed, request a single elevator to approach the floor. The blue buttons on the sides are request buttons (internal) for each of the elevators respectively, which is used to request a specific floor from a specific elevator. Using them is the only way two elevators can stop on the same floor, as well as allow your pretend passengers to reach their destination without involving the other elevator once they're inside.

You know, elevators.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...