Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 14 Vote(s) - 2.93 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Challenge Threadᆦ ᆦ ᆦ
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#1
Challenge Threadᆦ ᆦ ᆦ

I've decided, after FG did the first one, that it would be helpfull for everyone to launch challenges once in a while. So I create this thread, that most likely will just fall into the old forums, but well, it's worth the try...All in all I can solve it myself and it is something good already.

So, I decided to launch a challenge every now and then and give you members 24-48 hours to solve it. It will generally be a fast thing and I there's nothing you earn but knowledge. Every solution will be fully explained along with everything it comes with. Whoever wins the challenge will be able to launch the next challenge. If nobody wins the challenge in the given time I will do it. Note that before you launch something you must have solved it before, that includes me of course.

Objective: Pick up hard situations and help people know how they are done and mostly get experience and knowledge.

Rules:
Spoiler below!

- Any attempt to copy/steal/share someone's work on the challenge or if any questions asked here are directly about it will make the current challenge to be left unanswered and new one to be placed.

- Failure to complete the challenge in the given time will result in the challenge creator to give the solution of the challenge.

- If a challenge creator creates an impossible to solve challenge, he will not be able to solve the next challenge.

- It's acceptable for a group of people to work on the challenge as one.

- Everyone can participate, that includes FG.

- If this thread becomes inactive or if most people think this is a bad idea, this thread shall be removed.

- If two solutions are released in the same 2 hours, the one that is more complete/better coded or better in generally will be chosen.


- The solution shall be posted here once complete. Discussion about the challenge is also allowed in the thread, but keep it organized or else solutions might get lost.

- The solution will remain here for eternity after accepted.

- Once you complete the challenge you must place down the exact time the timer had when you finished it(REFRESH THE PAGE FIRST) to avoid having to check by the post hour.

- To participate you must make a post stating that you will try to solve the challenge currently active.

- You can only post one solution. There's no editing after that, if it's not as supposed, you fail.

- The solution consists of a working map with all required assets, an explanation and a commented script.

- Failure to give a solution with everything requested in the challenge details will result in the solver's elimination from the current challenge and his incomplete solution will become available for anyone to use and finish.

- The solution must be as complete as possible and as SIMPLE as possible. If in the challenge time two solutions appear in a close time range and one is a lot better than the other one, the better one will be used unless the first rule is broken.

- The challenger can give more time if no solution comes up at will, but can't do so without guarantee that he already solved the challenge.


Challenges:
____________________________________________________________________________



April, 10, 2012 - nemesis_567

"There is a room with a door, a rope and a crate. The player ties the crate to the rope and the door and when the player drops the crate into the hole, the door shall open."
Spoiler below!

Details:

- The room can start with the rope tied up already to the door(to avoid the main question of FG own situation for employment and avoid time wasting trouble), and there should be a support in the ceiling/wall so that the rope will be attached to it and only after that to the crate(to avoid collision errors).

- THERE MUST BE a check to know if the crate is falling down with enough speed to open a door, if it isn't, the door shall not open and the crate must hang by the rope and not fall down.

- You must not use a model as rope, you must use rope areas to solve the problem.

- The door must be a Move Object.

(More details because they were asked)

- There must be two or three rope areas only. Rope failed collision (rope trough floor or other objects) is accepted while controlled.

- The rope pulling actions must look realistic, but remember that this is a test map so it may not be extremely accurate.

Other Notes:

Because of the nature of this challenge if FG feels like it should remain unanswered I will remove it ASAP and replace it with another one.

Participants:

JetlinerX;
Palistov;


Winner: No Winner!

Solution and explaining:

Visit this link to obtain the solution: Here

Explaining it:

PHP Code: (Select All)
//Test script - Ropes by James Eisenhower

void OnStart()
{
    
FadeOut(0.0); //Start with a black screen
    
FadeIn(2.0); //Then slowly fade in^^
    
AddAttachedPropToProp("scriptCrate_1""scriptHook_1""meat_hook.ent"00.70000);//Attach hook to crate so it looks like there's something to attach the rope to.
    
AddUseItemCallback("RopeOnDoor""rope""scriptDoor_1""OnUseItem"false);//This is of no importance to this challenge and as such as no meaning.
    
AddUseItemCallback("RopeOnCrate""rope""scriptHook_1""OnUseItem"false);//This is of no importance to this challenge and as such as no meaning.
    
AddEntityCollideCallback("scriptHoleArea_1""scriptCrate_1""OnEntityCollide"false1);//When the crate 1 collides with the first script area in the hole, the function OnEntityCollide will be called.
    
AddEntityCollideCallback("scriptHoleArea_2""scriptCrate_1""OnEntityCollide"false1);//When the crate 1 collides with the second script area in the hole, the function OnEntityCollide will be called.
    
InteractConnectPropWithRope("PropConnectRope_1""scriptCrank_1""scriptRope_1"false666true0);//Connect the valve with the rope so that the valve controls the rope lenght. When this happens the rope will change it's lenght according to the valve's movement.
    
SetWheelAngle("scriptCrank_1"2.0true); //Ensure that the rope lenght is quite good and realistic the easy way.
    
AddDebugMessage("Game Started"true);//Useless
    
SetEntityInteractionDisabled("scriptCrank_1"true);//Make sure that the player can't mess with the wheel since it would harm up the level.
    
}




//THIS AS NO INTEREST FOR THE CHALLENGE ITSELF...SKIP
void OnUseItem(string &in asItemstring &in asEntity)//Called when an item is used. I do it this way for the sake of good coding practices and making the script easier to understand.
{
    
    if(
asItem == "rope")//If the item being used is the rope
    
{
        if(
asEntity == "scriptDoor_1")//If the object the item is used on is the door
        
{
        
        }
        else if(
asEntity == "scriptCrate_1")//if the object the item is used on is the crate.
        
{
        
        }
    }
}

void OnEntityCollide(string &in asParentstring &in asChildint alState//Called when two entities collide with each other
{
    
    if(
asParent == "scriptHoleArea_1")//If the entity that's receiving the collision from another is the first area in the hole(from top)
    
{
        if(
asChild == "scriptCrate_1")//If the entity that's colliding with asParent is the Crate
        
{
            
AddTimer("MovementTimer"10.0"nullFunction");//Creates a time to measure the time between the crate reaches scriptHoleArea_1 and scriptHoleArea_2
        
}
    }
    else if(
asParent == "scriptHoleArea_2")//If the entity that's receiving the collision from another is the second area in the hole(from the top)
    
{
        if(
asChild == "scriptCrate_1")//If the entity that's colliding with asParent is the Crate
        
{
            
            if(
calcSpeed(10.0-GetTimerTimeLeft("MovementTimer")) > 1//Only pass this condition if the velocity is enough. It would be unreal to just blow a lock without guarantee it was strong enough for it.
            
{
                
ropeEvent();//Do the rest of the functions that need to be done on the rope event.
                
AddDebugMessage("Rope EVENT triggered"true);//Useless now.
            
}
            
RemoveTimer("MovementTimer");//Make sure the timer is removed so it can be started again if need be.
        
}
    }
}

float calcSpeed(float Time//Calculates the speed given a time and based on the 9.87 gravitational accelaration on earth. Might not be accurate but it's just a formula and after you can set the values for min speed of the crate as you wish.
{
    
float v Time 9.87;//Velocity = Time * g(accelaration). I could just take the distance between areas instead of time and use Velocity = Distance/Time. IMPORTANT: The map has a small mistake, the first area should be on the floor level. As it is now it will not be managing the speed the crate has before reaching the first area. But as said before, this is just a reference value..
    
return v;
}

void ropeEvent()//Only exists for clearer reading and is described above.
{
    
InteractConnectPropWithRope("PropConnectRope_2""scriptCrank_1""scriptRope_2"false666false0);//Now connect the second rope with the crank so it doesn't suffer from the first change under OnStart but now is pulled to make a realistic effect.
    
InteractConnectPropWithRope("PropConnectRope_2""scriptCrank_1""scriptRope_3"false666true0);//Same as above but now the direction is inverted since the rope area and posnode are also inverted unlike before.
    
InteractConnectPropWithMoveObject("PropConnectDoor_1""scriptCrank_1""scriptDoor_1"falsefalse0);//Connect the door with the same crank so that it will open when the crank moves in the right direction. Using 1 valve for everything will make sure the movement of ropes are more or less the same.
    
SetWheelAngle("scriptCrank_1"10true);//Move the valve.
    
SetSwingDoorLocked("scriptDoor_1"falsefalse);//Useless, from previous script
    
SetSwingDoorClosed("scriptDoor_1"falsefalse);//Useless, from previous script
    
RemoveEntityCollideCallback("scriptHoleArea_1""scriptCrate_1");//Remove the entity collision of the crate with the area to avoid bugging up the level
    
RemoveEntityCollideCallback("scriptHoleArea_2""scriptCrate_1");//Same as above.





April, 12, 2012 - nemesis_567


"A certain monster is especially affected by iron, and when hit severall times by the player with it, it will fade away."
Spoiler below!

Details:

- Throwing iron to the monster must make different damage than hitting the monster itself with your hands.

- Health must be managed script side.

- There must be some indicator that the monster as taken damage, probably the monster already has it(flinch animation), so choose the right monster.

Participants till now:

Winner: Homicide13 - [url]http://www.mediafire.com/?zboyt8mglrfltbc[/url]
Solution: [url]http://www.mediafire.com/?ap067c2200lw3dq[/url]

PHP Code: (Select All)
//Test script - Ropes by James Eisenhower


class grunt //Create class grunt
{
        
grunt(int nInitialHealthstring asNamestring &in asSpawnArea//Constructor
        
{
            
nHealth nInitialHealth;//Initialize nHealth
            
sName asName;//initialize sName
            
CreateEntityAtArea(sName"servant_grunt.ent"asSpawnAreatrue);//Create the monster
            //AddEntityCollideCallback("scriptShovel_1", asName, "OnEntityCollide", false, 0); I was going to do this but the timer sounded more interesting.
            
bActive=true;//A class tracker, set to true for Active
            
bKilled false;//Same
            
AddDebugMessage("Succeed"false);
        }
        
bool isAttacked() const //For use with timer. Check if the monster is being attacked
        
{
            if(
GetEntitiesCollide(sName"scriptShovel_1")) return true;
            else return 
false;
        }
        
void giveDamage(int nDamage)//give the monster damage
        
{
            if(
bKilled == true) return;
            
nHealth -= nDamage;
            
PlaySoundAtEntity("attackSound""attack_claw_hit.snt"sName0.0ffalse);
            
CreateParticleSystemAtEntity("attackPS""ps_blood_tiny_splash.ps"sNamefalse); //It's not centered but I won't bother myself with it.
            
if(nHealth <= 0kill();
            
        }
        
string getName() const 
        {
            return 
sName;
        }
        
int getHealth() const
        {
            return 
nHealth;
        }
        
void kill() //Kill the monster
        
{
            if(
bKilled == true) return;
            
FadeEnemyToSmoke(sNametrue);
            
bKilled true;
        }
        
void disable()
        {
            if(!
bActive) return;
            
SetEntityActive(sNamefalse);
            
bActive false;
        }
        
void enable()
        {
            if(
bActive) return;
            
SetEntityActive(sNametrue);
            
bActive true;
        }
        private 
bool bActive;
        private 
int nHealth;
        private 
string sName;
        private 
bool bKilled;
}


 
grunt cTestGrunt(100"scriptGrunt_1""scriptArea_1"); //Create a grunt object.
int nCoolDown 0;


void Game(string &in asTimer)//Timer that controls everything
{
    
AddTimer("GamePlay"0.01"Game");
    if(
nCoolDown == 1) return;
    if(
cTestGrunt.isAttacked() && GetPropIsInteractedWith("scriptShovel_1")) 
    {
        
cTestGrunt.giveDamage(20);
        
nCoolDown 1;
        
AddTimer("CoolDown"0.5f"gameCoolDown");
        
AddDebugMessage("20 DAMAGE"false);
    }
    else if(
cTestGrunt.isAttacked()) 
    {
        
cTestGrunt.giveDamage(10);
        
nCoolDown 1;
        
AddTimer("CoolDown"0.5f"gameCoolDown");
        
AddDebugMessage("10 DAMAGE"false);
    }
    
}

void gameCoolDown(string &in asTimer)
{
    
nCoolDown 0;
    
AddDebugMessage("Works"false);
}



void OnStart()
{    
    
    
FadeOut(0.0); //Start with a black screen
    
FadeIn(2.0); //Then slowly fade in^^
    
AddTimer("GamePlay"0.1"Game");
    
SetEntityConnectionStateChangeCallback("scriptLever_1""OnEntityStateChange");

}

//

void OnEntityStateChange(string &in asEntityint alState//For testing purposes.
{
    if(
asEntity == "scriptLever_1")
    {
        
AddEnemyPatrolNode("scriptGrunt_1""scriptPathNode_1"0.0"Idle");
        
AddEnemyPatrolNode("scriptGrunt_1""scriptPathNode_2"0.0"Idle");
        
AddEnemyPatrolNode("scriptGrunt_1""scriptPathNode_3"0.0"Idle");
        
AddEnemyPatrolNode("scriptGrunt_1""scriptPathNode_4"0.0"Idle");
        
AddEnemyPatrolNode("scriptGrunt_1""scriptPathNode_5"0.0"Idle");
        
AddEnemyPatrolNode("scriptGrunt_1""scriptPathNode_6"0.0"Idle");
    }


April, 17, 2012 - Homicide13

"Matchbox Maze challenge: Free the box from the maze using script!"
Spoiler below!

Resources (MUST DOWNLOAD): http://[url]www.mediafire.com/?ajytkrmrz8fcwob[/url]

Details:

- None of the files except the .hps files may be changed (you can look at everything, but you may not make any changes).

-
The contents of all of the .hps files must be identical with each other.

-
The matchbox must escape from each of the the mazes without player interference (only through script).

Time:

[Image: 0_5e7_666666.png]

Participants:

-nemesis_567;
-DRedshot;
-Apjjm;
-YourComputer;


Winner: Apjjm;

Solution:

What was expected: http://www.mediafire.com/?xts0jk052z5dtvl

Apjjm's solution(s): http://www.frictionalgames.com/forum/thr...#pid133736


April, 26, 2012 - Apjjm

"A room contains two bridges. One of the bridges must be lifted by weighing down another enough to permit the player to cross the bridge to the edit door. Barrels and the player both act as weights."
Spoiler below!

Required resources: http://dl.dropbox.com/u/64805489/Challen...eApjjm.zip

Details:


  1. A counterweight puzzle must be designed (as bridge_1 moves down, bridge_2 moves up by the same amount). The movement of the bridges must be affected by the weight of the objects on the bridges (E.g. having one barrel on each bridge, then adding a second one to a bridge should move the second bridge down).
  2. Barrels or the player may be placed on a bridge to weight it down
  3. At least 4 barrels must be placed on the bridge_1 before the puzzle can be completed.
  4. Bridges must move up and down according to the weight difference.
  5. The player must "weigh" more than a barrel.
  6. It should not be possible to weight down a bridge so much that either clips through walls/floor.

Additional Notes:
  • You are free to change the bridge entity files
  • You are free to add or remove entities/areas/etc from the map
  • You may want to download this entity file (it may help depending on your approach).
  • Barrels should ideally be touching the bridge entities if they acting as weights.
Time: Challenge was solved.
[Image: 0_5q4_666666.png]

Participants:

- nemesis_567
- homicide13

Winner: nemesis_567

Solution:

PHP Code: (Select All)
void OnStart()
{
    
//Attach some prop detectors to the bridges
    
AddAttachedPropToProp("bridge_1","collider_1","bridgeCollider.ent",0,0,0,0,0,0);
    
AddAttachedPropToProp("bridge_2","collider_2","bridgeCollider.ent",0,0,0,0,0,0);
    
    
//Callbacks
    
AddEntityCollideCallback("barrel01_*","collider_1","cbAddPropBridgeDown",false,0);
    
AddEntityCollideCallback("Player","collider_1","cbAddPropBridgeDown",false,0);
    
AddEntityCollideCallback("barrel01_*","collider_2","cbAddPropBridgeUp",false,0);
    
AddEntityCollideCallback("Player","collider_2","cbAddPropBridgeUp",false,0);
    
}


//Add/Remove a prop to the bridge we need to pull down
void cbAddPropBridgeDown(string &in asParentstring &in asChildint alState)
{    
    if(
asParent == "Player")
        
AddLocalVarInt("BridgeDown",alState); //Player ways 3x more than a barrel...
    
else
        
AddLocalVarInt("BridgeDown",alState);
    
moveBridges();
}

//Add/Remove a prop to the bridge we need to pull up
void cbAddPropBridgeUp(string &in asParentstring &in asChildint alState)
{
    
    if(
asParent == "Player")
        
AddLocalVarInt("BridgeUp",alState); //Player ways 3x more than a barrel...
    
else
        
AddLocalVarInt("BridgeUp",alState);
    
moveBridges();
}

//Determine what levels the bridges should move to
void moveBridges()
{
    
//Relative weights on bridges
    
int up   GetLocalVarInt("BridgeUp");
    
int down GetLocalVarInt("BridgeDown");
    
int diff up down;
    
AddDebugMessage("Up: " up " Down: " down " Diff: " diff,false);
    
    
//Work out relative weights & clamp (to stop bridges going through the floor).
    
float state diff 0.1f;
    if(
state>1.0f)       state 1.0f;
    else if(
state<-0.5fstate = -0.5;
    
    
//Move based on relative weights
    
SetMoveObjectStateExt("bridge_1",-state,0.65f,1.5f,0.125f,true);
    
SetMoveObjectStateExt("bridge_2",state,0.65f,1.5f,0.125f,true);



Winner's solution: http://www.frictionalgames.com/forum/thr...#pid134824
Other solutions:
Homicide13: http://www.frictionalgames.com/forum/thr...#pid134941

May, 5, 2012 - nemesis_567

Very Hard -"Create a working camera system"
Hard -"Create an artificial coordinate system"
Medium -"Create a working market system"
Easy -"Create a player basic needs system."


Details:

  • Very Hard:
  1. You must create an system that allows the player to set the camera to move from a place to another using different kinds of motion. Circular, Elliptical, Trigonometrical and so on.
  2. It should be an header file( .h) to be included in a any kind of normal script using Apjjm #include thing.
  3. It must work under any circumstances and fail only at the game limitations. Might affect level editing(like require certain special type entities to be created for the info to be processed)
  4. You can use the level editor for the creation of Areas to tell where to move to if you wish.
  • Hard:
  1. You must create a system that allows the player to use coordinates for basic artificial functions.
  2. It should be an header file( .h) to be included in any kind of normal script using Apjjm #include thing.
  3. It must work under any circumstances and fail only at the game limitations.
  4. It can(depending on your approach) include a pre-analysis time in the beginning of a level to analyze collision data and thus provide a level layout of sorts. Might affect level editing(like require certain special type entities to be created for the info to be processed)
  5. Coordinates should(or not) use integer values.(To make it easier and less expensive).
  • Medium:
  1. You must create a system that allows the player to trade.
  2. It should be an header file( .h) to be included in any kind of normal script using Apjjm #include thing.
  3. You must be able to specify the market location, the instrument of trade and for each different market, you have to be able to specify different items.
  4. A market must have a way of activating(script area, on collision preferably) that should be set in the level editor.
  5. Each market must have an items stock. If it ends, and the player didn't sold anything, it will have nothing to sell, so it won't even start.
  6. There should be some sort of interface for each market(can be from GUI if possible to something like pick and drop items inside a location).
  • Easy:
  1. You must create a system that contemplates sleep deprivation, hunger, thirst, defecation and urinating systems.
  2. It must work well. This is, if the player just ate, he should loose hunger, and only after he must defecate, he can't do that if he is hungry as hell and didn't eat anything.
  3. If he does not find a good place to shit/pee( good places must be specified via script areas, via the areas name), he will pee/shit wherever he is and loose sanity(a lot).
  4. If he does not find a bed to sleep, he shall sleep wherever he is, if the place is not safe(if there is a monster near him somewhere or something you decide), he should die and a message explaining why shall appear, otherwise he should just wake up.
  5. Drinks and food can be any item specified in the source file later on.(Mustn't be static)
  6. If the player is too hungry he should loose sanity and if he is too thirsty he should loose both health and sanity(sanity at a bigger rate than health).
Note: I myself couldn't finish the challenges, but I know they are all solvable since I've planned correctly them all. I just have no interest in keep you all waiting. They're all safe to try to solve. The reason for difficulty levels is due to a certain post in this thread.
Time:

[Image: 0_5yk_666666.png]

Participants:


(This post was last modified: 05-08-2012, 07:28 PM by nemesis567.)
04-10-2012, 02:49 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#2
RE: [CHALLENGE THREAD]

[Image: challenge-accepted.jpg]

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-10-2012, 04:49 PM
Website Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#3
RE: [CHALLENGE THREAD]

How to get employed by Frictional Games:
1. Read employee test.
2. Make challenge thread.
3. Have the whole community solve the challenge for you.
4. Claim that you solved the test all by yourself.
5. Get employed by Frictional Games.
6. Get fired after a week because you can't work.


Noob scripting tutorial: From Noob to Pro

04-10-2012, 05:12 PM
Find
AnthonyTrix Offline
Junior Member

Posts: 17
Threads: 5
Joined: Apr 2012
Reputation: 0
#4
RE: [CHALLENGE THREAD]

(04-10-2012, 05:12 PM)Cranky Old Man Wrote: How to get employed by Frictional Games:
1. Read employee test.
2. Make challenge thread.
3. Have the whole community solve the challenge for you.
4. Claim that you solved the test all by yourself.
5. Get employed by Frictional Games.
6. Get fired after a week because you can't work.
^ This. ^

04-10-2012, 05:40 PM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#5
RE: [CHALLENGE THREAD]

I will definitely take that as an insult. If the challenge is not solved within the time I will give the solution. One of my rules is to have it solved before, something I did. If you are not interested, do not participate.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
04-10-2012, 05:45 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#6
RE: [CHALLENGE THREAD]

(04-10-2012, 02:49 PM)nemesis567 Wrote: Because of the nature of this challenge if FG feels like it should remain unanswered I will remove it ASAP and replace it with another one.
^I have an idea of how this can be done, but I'll stay out until this has been confirmed.
04-10-2012, 06:13 PM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#7
RE: [CHALLENGE THREAD]

Untill what exactly is confirmed?

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
04-10-2012, 06:24 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#8
RE: [CHALLENGE THREAD]

(04-10-2012, 06:24 PM)nemesis567 Wrote: Untill what exactly is confirmed?
If they think its okay.


04-10-2012, 06:28 PM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#9
RE: [CHALLENGE THREAD]

Oh. I hope they do since this is not even the hard part of their challenge, it's a modified version of the easy part of it. I don't see why shouldn't they allow it.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
04-10-2012, 06:35 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#10
RE: [CHALLENGE THREAD]

Because you don't want to sabotage their employment efforts by having someone steal the answer from this thread or something, that's why. Tongue

04-10-2012, 06:53 PM
Find




Users browsing this thread: 4 Guest(s)