After two years of preparation, the largest vote in Scotland's history is almost under way.

More than four million people are registered to cast their vote across 32 local authorities tomorrow, and in doing so will determine the country's future as an independent state or to remain part of the United Kingdom.

The will of the nation will be announced on Friday morning at the Royal Highland Centre outside Edinburgh by chief counting officer (CCO) Mary Pitcaithly.

As convenor of Scotland's Electoral Management Board Ms Pitcaithly has responsibility for ensuring the proper and effective conduct of the referendum, including the poll and count.

When Scotland's 2,608 polling places close at 10pm the sealed boxes containing the ballot papers will be collected and transported to each local authority's designated count venue - in most cases a school, sports centre or town hall.

The number of ballot papers in each box will be counted by a 5,767-strong counting team and the total will be reported to the CCO who will authorise the local counting officer to announce the turnout.

Then comes the important part: the papers will be sorted into Yes, No and those deemed "doubtful". These will need to be judged and possibly rejected as spoiled.

After reporting to the CCO, each local authority will announce its result, with the first declaration expected at around 1.30am and the last at around 6am.

Ms Pitcaithly will then make the final declaration.

Here are some questions about the vote and count procedure:

Q: Turnout could be as high as 85%. Will there be enough ballot papers to go round?

A: Papers can be spoiled before they reach the ballot box, so 120% of the papers required for the vote have been printed as a precaution.

Q: No trouble is expected at polling places, but what if it happens?

A: The Scottish Independence Referendum Act 2013 does address the possibility. Where proceedings at any polling place are interrupted by riot they will be adjourned until the following day.

Q: What happens if people are still waiting to vote when polls close?

A: At 10pm a member of polling place staff will mark the end of any remaining queue. All those waiting will be able to cast their vote but for anyone arriving beyond this point it will be too late.

Q: What constitutes a void ballot paper?

A: Any paper which indicates a vote in favour of none or both answers to the referendum question "Should Scotland be an independent country?".

Any paper on which anything is written or marked which could identify the voter.

Q: Won't it take a long time to collect ballot boxes from all over Scotland's remote Highlands and Islands?

A: Local authorities such as Orkney Islands Council do not have polling stations on their many isles. Instead voters can apply for a postal vote or travel to the mainland to vote. It means there is no need to wait for ballot boxes to travel long distances by plane or boat.

Q: What time can we expect the national declaration?

A: Officially, "breakfast time". A survey of councils suggests Aberdeen will be the last council to declare at 6am and the national result will come soon after.

Q: Will we be able to establish early on which way the vote will go?

A: Results will be announced through the night by each of the local authorities. There may be a "tipping point" where it is clear from the total number of votes cast and the result so far that a winning side has emerged.

Q: What about a recount?

A: A counting officer or the CCO can request a local recount if he or she considers it appropriate. A recount would only be requested if there was some doubt over the process - for example if there were concerns over a mix-up with the ballot papers or that some had not been counted. The closeness of the vote is not justification to order a recount. The CCO cannot order a recount after the result has been declared.

Former lawyer Ms Pitcaithly has been leader of Falkirk Council since 1998. She was a depute returning officer for Scotland's 1997 referendum and was the regional counting officer for Scotland in the 2011 AV referendum.

She said: "We've been modelling everything on a 70 to 90% turnout so we're prepared for whatever happens tomorrow. We have committed and experienced teams across all 32 local authorities."

Ms Pitcaithly said of her role in the proceedings: "It's a significant responsibility but also an honour and a privilege to be involved in the referendum.

"But it's also work, and I get excited about every election.

"They are hugely important and as election professionals our job is to make sure they go well and that everybody is confident in the result."

Spoiled papers generally represent around 3% of votes cast in a ballot but it is hoped that with a single question to answer, the figure on Thursday will be lower.

The Electoral Commission said it has received more than 400 calls about the voting process at polling places.

Andy O'Neill, head of the Commission in Scotland, said: "We know a lot of people will be voting for the first time on Thursday and we want no one to miss out.

"Make sure you know where your polling station is and when you get there place an 'X' on your ballot paper. You don't need a poll card to be able to cast your vote, but if you have it, do bring it as it will speed up the process inside the polling place.

"All the information can be found in the Electoral Commission's voting guide at www.aboutmyvote.co.uk. In addition, the Commission's helpline on 0800 3 280 280 will be available throughout polling day to help voters with any queries about the voting process."