Implementing Logic Chess in AAO

Get started with the upcoming AAO version 6.

Moderator: EN - Forum Moderators

Post Reply
Gamer2002
Posts: 559
Joined: Thu Jan 22, 2009 10:51 pm

Implementing Logic Chess in AAO

Post by Gamer2002 »

The following tutorial explains how to implement basic Logic Chess mechanic on the AAO. It does not cover how to implement Logic Chess with exact same visuals.
Before we begin..
This tutorial is for advanced users of AAO. You are required to known how to
- Set game over redirection
- Define variable
- Use variable to redirect player to another frame
- Use runtime expression to control player’s life reduction

How can Logic Chess work on AAO?
It’s not a rocket science, really. Logic Chess is, basically, a dialogue with branch choices. What makes it exciting and harder to implement is the time limit for selecting your answers. There are several ways around it that are possible on AAO, all require to use hp bar as your time bar.
- Reduce a little of hp for each answer to emulate running out of time without having any actual time limitations. The problem is that this is lame.
- Set duration of question for a very short time, reduce 1 hp if time passes before the answer and loop back to the question. The problem is that the question and answers will constantly show up and disappear, and this will be annoying.
- Set duration of question for a bit of longer time, reduce few hp if time passes before the answers and loop back to the question. You can also write some kind of message for timeout penalty. That’s a bit better, but the timeout penalty either will be very annoying to the player (if he has very little time) or too forgiving (if he has a lot of it).

My approach is different. Using function f:get_date() I store the exact times of player seeing the question and answering to it. After the question is answered, the hp is reduced depending on the difference between both times.
Additionally, I’m giving the player a limited short amount of time to answer the question. After that time runs out, the player receives penalty for lost time, while being mocked by his opponent for hesitating with the answer. Thanks to that, the player is constantly reminded about the time passing without being distracted too much.

Used variables
Naturally, you are free to name your variables as you wish, but in my example variables are:
ONE_HP – Set once before the start of LC, stores how much time (in milliseconds) has to pass to lose one point of HP. I’ve set it to 250.
Q – set when a question is asked, stores id of the question.
T – set when a question is asked, stores the time of question being asked. When you redirect player back to the question, you must make sure this variable is set again.
C – set to the 0 before the start of LC. It is a clue variable, it is changed to 1 when the player finds a clue necessary to proceed further. There can be more than one of such variables.

One question – 3 frames.
- Frame 1; duration 1ms. Sets Q for id of current question, sets T to store value from f:get_date(). This is where you redirect the player back.
- Frame 2; duration of X ms. Here, you are asking the player to select his answer.
- Frame 3; duration of 1 ms. Redirects player to section where he is penalized for losing X amount of time. After this, he is automatically redirected back to Frame 1.

X has to be set manually to the value of {size of timeout penalty} * ONE_HP. My timeout penalty is 16, so I set X to 4000 ms.

Post the answer hp reduction
After selecting any answer the player must be directly redirected to a frame that reduces his hp.
Duration 1ms. Reduces player health by (f:get_date() - T)/ONE_HP.

Timeout penalty
In timeout penalty section, the opponent character mocks the player for hesitating and penalizes him according to {size of timeout penalty}. The text disappears automatically. After it, thanks to variable Q, the player is redirected to the exact question he came from.

Wrong answer penalty
Has structure of normal penalty message. The variable Q is used to redirect the player. According to Logic Chess rules, instead of getting him back to the exact question, the player is redirected to the core question of current Logic Chess turn.

Clues
Originally, responsible for the clue variable C is set to 0. Using a simple condition evaluation, the player is redirected to “I’ve need to find a clue” message or proceeds further with his line of questioning, depending if he has found the clue (C=1) or not (C=0). Variable C, or any other variable, can be also used to redirect the player to “I’ve already finished this line of questioning” message after completing said line of questioning.

Can I use V5 instead?
Yes, but it’s not recommended. V6 allows to define many variables in one frame, has shorter minimal duration of a frame, and has simpler mechanic of redirecting the player depending on variable’s value.
Last edited by Gamer2002 on Wed May 23, 2018 7:16 pm, edited 1 time in total.
Image
Image
Image
Justice233
Posts: 3
Joined: Thu Jul 19, 2012 10:51 pm
Gender: Male
Spoken languages: English

Re: Implementing Logic Chess in AAO

Post by Justice233 »

Image

Is this a sufficient background?
And what music should I use, Logic, Logic and Trick or Tricks and Gimmicks?
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: Implementing Logic Chess in AAO

Post by Enthalpy »

* That background is good for logic chess with Investigation sprites. As Gamer shows, it makes more sense to use his background if you're working with standard AA sprites. If you need it, open Gamer's trial in the v6 editor, and see if you can find his background yourself. Remember not to hotlink!
* Go with the "Logic Chess" tracks from Ace Attorney Investigations 2 unless you have a specific reason for other music. Moderato and Allegro work just as with cross-examinations.
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
Gamer2002
Posts: 559
Joined: Thu Jan 22, 2009 10:51 pm

Re: Implementing Logic Chess in AAO

Post by Gamer2002 »

It's actually not my background, I asked someone else for it when I was working on one of my unpublished cases.

I think this person made a LC without real time limits and I called his idea lame. Oh my.

Oh well, I'm posting this background to make it more accessible.
Image

This perspective is kinda lame.
Image
Image
Image
AceAttorneyMaster111
Posts: 468
Joined: Sat Sep 27, 2014 6:46 pm
Gender: Male
Spoken languages: English, français, un poco de español, עברית
Location: USA

Re: Implementing Logic Chess in AAO

Post by AceAttorneyMaster111 »

Where did you get the resources for the chess pieces?
Gamer2002
Posts: 559
Joined: Thu Jan 22, 2009 10:51 pm

Re: Implementing Logic Chess in AAO

Post by Gamer2002 »

IIRC Court Records has them ripped.

http://www.court-records.net/ripsgk2.htm

They don't have all pieces. If you need more, search for Ace Attorney Investigation 2 sprites rips.
Image
Image
Image
Post Reply